Stateflow User's Guide Previous page   Next Page

Moving and Resizing States

To move a state, do the following:

  1. Click and drag the state.
  2. Release it in a new position.

To resize a state, do the following:

  1. Place the cursor over a corner of the state.
  1. When the cursor is over a corner, it appears as a double-ended arrow (PC only; cursor appearance varies with other platforms).

  1. Click and drag the state's corner to resize the state and release the left mouse button.

Creating Substates and Superstates

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.

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, double-click the state or its border.

Stateflow thickens the grouped state's border and grays its contents to indicate that it is grouped.

You can also group a state by right-clicking it and then selecting Make Contents and then Grouped from the resulting shortcut menu.

You must ungroup a superstate to select objects within the superstate. To ungroup a state, double-click it or its border or select Ungrouped from the Make Contents shortcut menu.


Previous page  Creating a State Specifying Substate Decomposition Next page

© 1994-2005 The MathWorks, Inc.