Main Content

Execution in MATLAB

Execute standalone Stateflow® charts as objects in MATLAB®

Design logic by using state charts and execute that logic as MATLAB programs. Execute and unit test your chart in the Stateflow editor. Control the behavior of user interfaces and data processing applications through your chart.

Functions

expand all

Stateflow.exportAsClassExport MATLAB class for standalone chart (Since R2019b)
Stateflow.exportToVersionExport standalone chart for use in previous version of Stateflow (Since R2020a)

Stateflow Syntax

expand all

Change Detection

hasChangedDetect change in data since last time step
hasChangedFromDetect change in data from specified value
hasChangedToDetect change in data to specified value

Temporal Logic

afterExecute chart after event broadcast or specified time
atExecute chart at event broadcast or specified time
countNumber of chart executions during which condition is valid
elapsedTime since state became active
everyExecute chart at regular intervals
temporalCountNumber of events, chart executions, or time since state became active

Topics

Troubleshooting

Debug a Standalone Stateflow Chart

Interrupt execution to step through each action in a Stateflow chart.