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 件のコメント

Walter Roberson
Walter Roberson 2012 年 4 月 26 日
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 2013 年 4 月 11 日
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 2013 年 4 月 11 日
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).

サインインしてコメントする。

回答 (0 件)

カテゴリ

製品

質問済み:

2012 年 4 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by