- Declare unsupported MATLAB functions as extrinsic using coder.extrinsic. If you scroll down, the documentation link has an example using plotting commands, which are not supported for code generation. You'd have to do to the same for all Symbolic Math Toolbox commands like syms .
- If your function inputs and outputs are all of double data type so that you can put them together in a vector, you can also use the Interpreted MATLAB Function block.
Running fcn.m file in a block on simulink
5 views (last 30 days)
Show older comments
Hi ! I was wondering wether there was anyway to call a function.m file in simulink, having created the file in Matlab, in a simulation ?
I know the use of the Matlab Function block, but in my particular case, I need to declare some symbolic variables ('syms s t') to use in an inverse Laplace transformation that will give me my output signal.
Therefore, the declaration of my symbolic variable is not supported while generating the C code of the Matlab Function block, that's why i can't use it.
Also I'm trying to find a way without using S-Function block in Simulink if possible !
Cheers
0 Comments
Accepted Answer
Sebastian Castro
on 20 Nov 2014
Yael,
If you want this to just run within the MATLAB environment (i.e., you're not generating code from your model), you can do one of two things:
The Interpreted MATLAB Function block is probably easier, but I'd recommend using coder.extrinsic if you can.
Best, Sebastian
More Answers (0)
See Also
Categories
Find more on Simulink Coder in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!