Is there a way to create Embedded MATLAB (EML) function blocks using the API in Stateflow?

I would like to create EML functions using the Stateflow API; however, the documentation does not mention how I can pass in the code of the EML function.

 Accepted Answer

This information has been included in the documentation of Stateflow 7.1 (R2008a). For previous product releases, you can use the 'Script' property of the Embedded MATLAB function to achieve this. See a sample code below:
process_function_box = Stateflow.EMFunction(sClusterA);
str=sprintf(' y=process(x)\n y=x;');
process_function_box.script=str;

More Answers (0)

Categories

Products

Release

R2007b

Community Treasure Hunt

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

Start Hunting!