Procedure calls from Stateflow
Ältere Kommentare anzeigen
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.
Antworten (1)
Kaustubha Govind
am 6 Mär. 2012
0 Stimmen
I haven't done this myself, but you might find this documentation page useful: Example of a MATLAB Function in a Stateflow Chart.
Kategorien
Mehr zu Decision Logic finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!