Is it possible to access the value of a MATLAB workspace parameter from within a TLC file?

2 views (last 30 days)
I am using custom source code and header files in Simulink and I would like to be able to generate a parameter value which is defined in the MATLAB workspace in the generated source code. The parameter is not used in any Simulink block directly which is why inlining parameters would not be useful.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 20 Apr 2011
To get the value of a MATLAB workspace parameter into the generated code of a Simulink model via a TLC directive you can use the following syntax:
%assign b = FEVAL("evalin","base","a")
%<b>
For an example S-Function and TLC file please see attached application.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!