Procedure calls from Stateflow
显示 更早的评论
I'm new to using Stateflow, so I'm looking for advice on how I to write a function within a Stateflow chart which will call an external MATLAB model based on a boolean input parameter. I have several models to execute from the chart, so I would like to reuse the same function declaration by passing both the external model name and the boolean flag as input parameters to the function rather than performing a separate "if check" for each model call. Here's an example of the intent:
MATLAB function: function CallProc(FncName, EnableFlag) if (EnableFlag) FncName; end if;
Stateflow call: {CallProc(ModelName, ModelEnabled);}
I have about 50 models to call from within the same chart, so the ModelName & ModelEnabled paremeters will change for each model. If anyone can provide any insight into how to accomplish this, I'd appreciate it.
回答(1 个)
Kaustubha Govind
2012-3-6
0 个投票
I haven't done this myself, but you might find this documentation page useful: Example of a MATLAB Function in a Stateflow Chart.
类别
在 帮助中心 和 File Exchange 中查找有关 Decision Logic 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!