Problems with writing Transfer Functions as Rational Expressions in s - matlab

Why do I get the error:
[Undefined function 'tf' for input arguments of type 'char'.]
when I'm trying to use [s=tf('s');]?
The code worked just fine before updating my license, so I'm wondering if I missed something in the update.

Taking a look at the documentation, you see at the top left that the function tf is part of the control systems toolbox. The output of ver tells you that no toolboxes are installed or activated. If you previously had the toolbox present on the same system there is probably a license issue. Try deactivating / activating the license.

Related

What version of Matlab should I install to make dsearch() work?

I have a code in MATLAB that I need to run once to get some quick reference results. This code uses dsearch(), and I relized that this function has become deprecated and has been substituted by dsearchn(). I tried to follow some suggestions to make it work but I didn't succeed (it's my absolute first time with MATLAB) and I just need to run this code once to get some numbers. Which MATLAB versione should I install to make it work?
dsearch was removed in MATLAB R2012a, therefore you may use any version of MATLAB before R2012a.
If you have an active MathWorks account, you may access the documentation archive here.
According to MathWork's release notes, this function started printing a warning on release 2010a. So you should be fine either using it or a previous version.

Matlab: error message "??? The library 'ImfilterBuildable' is not supported by the current target, language or compiler."

Program: Matlab R2014a.
Issues:
I tries to translate matlab code to Cortex-M3 C code by Matlab code.
The following error message shown:
"??? The library 'ImfilterBuildable' is not supported by the current target, language or compiler."
I can not find related information by key word "ImfilterBuildable".
And it is workable when choose the platform as "Host computer".
Do any one can support this issue?
Thanks in advance.
Albert Ke
In R2014a, imfilter used platform specific libraries in generated code. So only the platforms which is usually the host computer was supported for code generation. In the latest release imfilter generates code for other targets and uses platform specific libraries only for host computer targets.
In short, imfilter is not supported for Cortex-M3 code generation in R2014a.
You can see R2014a documentation for imfilter at http://www.mathworks.com/help/releases/R2014a/images/ref/imfilter.html
Latest documentation is at
http://www.mathworks.com/help/images/ref/imfilter.html
Check out the code generation section in both.

Scicos Code generation for rt_preempt system

Due to http://hart.sourceforge.net/, code generation should work for rt_preempt kernels, when using scilab 5.3.2 and hart toolsbox.
I installed both on ubuntu 12.04 LTS sucessfully, but I'm kind of lost with the code generation. I use one of the hart toolbox examples (realtime_demo), and try to compile and generate code.
First off all: Are these samples supposed to work with rt_preempt or only with RTAI? what code generation commands do I have to use for rt_preempt kernels?
If anybody managed code generation for rt_preempt kernels, I would aapreciate every hint I can get!
Code generation for rt_preempt is automatically enabled, if the hart-toolbox did not detect RTAI during installation. Thus, if you don't have RTAI, by compiling your schematic you should get code that runs using rt_preemption (if this is also not available, then your code will run as a normal Linux process). However at the moment there is no way to get data in or out of the real-time process, as the RTAI scopes, meters can not be used. To overcome this communication issue and also other limitations of Xcos concerning the implementation of real-time systems, you could also have a look at OpenRTDynamics as an alternative.

Compiling Simulink Code into .ELF object form

I have a simple model from simulink and I would like to generate code using the code generator in the simulink and then compile it using gcc into a .ELF object file. How can I proceed?
Thanks
You need the product called Simulink Coder (around matlab 2011b) or Real-time Workshop (for older matlab versions). Typing ver at the matlab command window will show what products and licences you have installed.
If Simulink Coder or RTW are installed, you use the menu Simulation->Configuration Parameters to set up the model for code generation.
If you have Embedded Coder you can set System Target File to ert.tlc, and this will produce a very concise main() routine to call your model code. Otherwise, use grt.tlc which produces a lot more bloat then ert, but is the only useful one available for on Windows.
There are a lot of options to go through and check - it really needs someone with a bit of experience to be present!
As you are requesting an ELF file, is this for an embedded system? If so, there is a lot more work to be done. If the target is not one of the already supported targets, then you need a target package, which will take either a lot of time and experience, or money to buy one.
Custom target development - a world of it's own:
http://www.mathworks.co.uk/help/toolbox/rtw/ug/bse3b2z.html

Failed to find library 'powerlib' matlab. Simulink program executing

When I tried to run a Simulink program under my R2009a Matlab, it showed an error message as follows: Failed to find library 'powerlib' referenced by 'dcmotor_openloop/Armature Current '. This library must be on your MATLAB path.
I'm wondering where I can find this powerlib.
As #Edric mentioned, powerlib is built into SimPowerSystems. The error you see can thus have two causes
(1) There is no installation of SimPowerSystems in your copy of Matlab. Type ver at the command prompt to check for what toolboxes you have installed. If SimPowerSystems doesn't show up in the list, you will have to get the toolbox, otherwise you won't be able to run the model.
(2) Your installation of SimPowerSystems is somehow corrupt. This has never happened to me in Matlab so far, but with modern technology, anything is possible. A fresh install should solve this.
powerlib is a Simulink library shipped as part of SimPowerSystems, see the product page here: http://www.mathworks.com/products/simpower/.
This should really be a comment on another answer, but I can't comment due to reputation.
From at least R2016b, perhaps earlier too, It's no longer called SimPowerSystems. It's now SimscapePowerSystems. You need that plus the bare Simscape package installed.