Here is an example of a Stateflow® chart, which models as a finite-state machine the logic required to shift gears in an automatic transmission system of a car:
Notice the following details in this chart:
Each gear and shift position is represented by a state.
States having a dashed boundary, such as
are parallel (can be active concurrently).
States with a solid boundary, such as
are exclusive (only one can be active at a time).
Transitions can be triggered by events and conditions.
Directed-event broadcasts, such as
trigger selective execution of chart logic.
This chart is part of an example model called
ships with the Stateflow product. To explore the model further,
open it by typing
sf_car at the command prompt
in the MATLAB® Command Window.