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!