Stateflow | ![]() ![]() |
Moving and Resizing States
To move a state, do the following:
To resize a state, do the following:
Creating Substates
A substate is a state that can be active only when another state, called its parent, is active. States that have substates are known as superstates. To create a substate, click the State tool and drag a new state into the state you want to be the superstate. Stateflow creates the substate in the specified parent state. You can nest states in this way to any depth. To change a substate's parentage, drag it from its current parent in the state diagram and drop it in its new parent.
Note A parent state must be large enough to accommodate all its substates. You might need to resize a parent state before dragging a new substate into it. |
Grouping States
Grouping a state causes Stateflow to treat the state and its contents as a graphical unit. This simplifies editing a state diagram. For example, moving a grouped state moves all its substates as well.
To group a state, do one of the following:
Stateflow thickens the grouped state's border and grays its contents to indicate that it is grouped. To ungroup a state, double-click it or its border or select Ungrouped from the Make Contents submenu units context menu. You must ungroup a superstate to select objects within the superstate.
![]() | Creating a State | Specifying Substate Decomposition | ![]() |