Syntax for States and Transitions
Control the execution of your Stateflow® chart by specifying when transitions between states occur and when actions are executed. Synchronize state execution by broadcasting events. Detect changes in data values and check which states are active during chart execution.
Blocks
Stateflow Syntax
Topics
- Differences Between MATLAB and C as Action Language Syntax
Compare the functionality of the chart action languages.
- Guidelines for Naming Stateflow Objects
Reserved keywords, name length restrictions, and naming limitations.
- Eliminate Redundant Code by Combining State Actions
Combine
entry
,during
, andexit
actions in a state. - Control Function-Call Subsystems by Using bind Actions
Bind a function-call output event to the activity of a state.
- Combine Transitions and Junctions to Create Branching Paths
Create decision points in transition paths.
- Call Extrinsic MATLAB Functions in Stateflow Charts
Access MATLAB® functions that are not supported for code generation.
- Access MATLAB Functions and Workspace Data in C Charts
Call built-in MATLAB functions by using the
ml
operator. - Call C Library Functions in C Charts
Access C functions in state and transition labels.
- Check State Activity by Using the in Operator
Determine if a state is active during chart execution.
- Detect Changes in Data and Expression Values
Define chart behavior when data and expressions change value between time steps.
- Control Chart Execution by Using Temporal Logic
Use event-based and absolute-time temporal logic operators.
- Control Chart Behavior by Using Implicit Events
Trigger chart actions by changes in data values and state activity.
- Reduce Transient Signals by Using Debouncing Logic
Design state machines that are resilient to rapidly changing signals.
- Control Oscillations by Using the duration Operator
Simplify debouncing logic in charts that have transient signals.