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.

 采纳的回答

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;

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Stateflow 的更多信息

产品

版本

R2007b

Community Treasure Hunt

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

Start Hunting!

Translated by