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.

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 6 de Mzo. de 2012

0 votos

I haven't done this myself, but you might find this documentation page useful: Example of a MATLAB Function in a Stateflow Chart.

Categorías

Más información sobre Decision Logic en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 6 de Mzo. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by