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 Comments

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) ?
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.
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).

Sign in to comment.

Answers (0)

Products

Asked:

on 26 Apr 2012

Community Treasure Hunt

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

Start Hunting!