Symbolic in embedded matlab

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 comentarios

Walter Roberson
Walter Roberson el 26 de Abr. de 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
sidra jabeen el 11 de Abr. de 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
Kaustubha Govind el 11 de Abr. de 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).

Iniciar sesión para comentar.

Respuestas (0)

Productos

Preguntada:

el 26 de Abr. de 2012

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by