Symbolic in embedded matlab
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 26 Avr 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
le 11 Avr 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
le 11 Avr 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).
Réponses (0)
Catégories
En savoir plus sur Naming Conventions dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!