Procedure calls from Stateflow
Show older comments
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.
Answers (1)
Kaustubha Govind
on 6 Mar 2012
0 votes
I haven't done this myself, but you might find this documentation page useful: Example of a MATLAB Function in a Stateflow Chart.
Categories
Find more on Decision Logic in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!