Stateflow | ![]() ![]() |
Creating a State
You create states by drawing them in the Stateflow diagram editor for a particular Stateflow chart (block). The following is a depiction of the Stateflow diagram editor:
To activate the State tool, click or double-click the State button in the Stateflow toolbar. Single-clicking the button puts the State tool in single-creation mode. In this mode, you create a state by clicking the tool in the drawing area. Stateflow creates the state at the specified location and returns to edit mode.
Double-clicking the State button puts the State tool in multiple-creation mode. This mode works the same way as single-creation mode except that the State tool remains active after you create a state. You can thus create as many states as you like in this mode without having to reactivate the State tool. To return to edit mode, click the State button, or right-click in the drawing area, or press the Esc key.
To delete a state, select it and choose Cut (Ctrl+X) from the Edit or any shortcut menu or press the Delete key.
![]() | Using States in Stateflow Charts | Moving and Resizing States | ![]() |