Stateflow | ![]() ![]() |
Specifying State Decomposition
Stateflow allows you to specify whether activating a state activates all or only one of its substates. A state whose substates are all active when it is active is said to have parallel (AND) decomposition. A state in which only one substate is active when it is active is said to have exclusive (OR) decomposition. An empty state's decomposition is exclusive. You can alter a state's decomposition only if it contains substates. To alter a state's decomposition, select the state, press the right mouse button to display the state's shortcut menu, and choose either Parallel (AND) or Exclusive (OR) from the menu.
You can also specify the state decomposition of a chart. In this case, Stateflow treats the chart's top-level states as substates of the chart. Stateflow creates states with exclusive decomposition. To specify a chart's decomposition, deselect any selected objects, press the right mouse button to display the chart's shortcut menu, and choose either Parallel (AND) or Exclusive (OR) from the menu.
The appearance of a superstate's substates indicates the superstate's decomposition. Exclusive substates have solid borders, parallel substates, dashed borders. A parallel substate also contains a number in its upper right corner. The number indicates the activation order of the substate relative to its sibling substates.
![]() | Grouping States | Specifying Activation Order for Parallel States | ![]() |