Symbolic in embedded matlab
Show older comments
Hello,
I wanted to use the symbolic command('syms') in embedded matlab function block in the simulink model. Example: In my model there are 9 input to the embedded matlab function, which are used to solve for the 3 variables (3 equations available).
Is it possible to solve equations symbolically, or can the embedded matlab function call other m-file or function that solves equation symbolically.
-------------------------------------------
Example of a simple function:
function y = fcn(u)
%#eml
syms a
a=solve(a-u-10);
y =a;
(u-input, a-variable, y- output)
---------------------------------------------
Thanks
Varun
3 Comments
Walter Roberson
on 26 Apr 2012
Which use of "embedded matlab" do you need? Are you using Simulink Accelerator, or just a MATLAB Function Block, or are you needing to generate C code (e.g., a MEX file) ?
sidra jabeen
on 11 Apr 2013
i am also facing the same problem. trying to use symbolic variable in embede matlab function. while my code is working fine in .m file but simulink eml do not support syms command that is symbolic variables. kindly help me out in doing this task in simulink embeded matlab function.
Kaustubha Govind
on 11 Apr 2013
You might want to put the calls to the Symbolic Toolbox in a separate MATLAB function and call that from the block after declaring it as coder.extrinsic (eml.extrinsic in older versions).
Answers (0)
Categories
Find more on Symbolic Computations in MATLAB 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!