A transition is a line with an arrowhead that links one graphical object to another. In most cases, a transition represents the passage of the system from one mode (state) to another. A transition typically connects a source and a destination object. The source object is where the transition begins and the destination object is where the transition ends. For more information, see Transitions.
Follow these steps to create transitions between states and junctions:
Place your pointer on or close to the border of a source state or junction.
The pointer changes to crosshairs.
Click and drag a transition to a destination state or junction.
Release on the border of the destination state or junction.
Attached transitions obey the following rules:
Transitions do not attach to the corners of states. Corners are used exclusively for resizing.
Transitions exit a source and enter a destination at angles perpendicular to the source or destination surface.
All transitions have smart behavior.
To delete a transition, click it and select Edit > Cut, or press the Delete key.
See the following sections for help with creating self-loop and default transitions:
Transition labels contain syntax that accompanies the execution of a transition. The following topics discuss creating and editing transition labels:
For more information on transition concepts, see Transition Label Notation.
For more information on transition label contents, see Transition Action Types.
Label unlabeled transitions as follows:
Select (left-click) the transition.
The transition changes to its highlight color and a question mark
(?) appears on the transition. The ? character is
the default empty label for transitions.
Left-click the ? to edit the label.
You can now type a label.
To apply and exit the edit, deselect the object. To reedit the label, simply left-click the label text near the character position you want to edit.
Specify, as appropriate, relevant names for
The event or message that causes the transition to be evaluated.
Defines what, if anything, has to be true for the condition action and transition to take place.
If the condition is true, the action specified executes and completes.
|This action executes after the source state for the transition is exited but before the destination state is entered. Transition actions are supported only in Stateflow® charts in Simulink® models.|
Transitions do not need labels. You can specify some, all, or none of the parts of the label. Rules for writing valid transition labels include:
Can have any alphanumeric and special character combination, with the exception of embedded spaces
Cannot begin with a numeric character
Can have any length
Can have carriage returns in most cases
Must have an ellipsis (...) to continue on the next line
You can move transition lines with a combination of several individual movements. These movements are described in the following topics:
In addition, transitions move along with the movements of states and junctions.
You can move or "bow" transition lines with the following procedure:
Place your pointer on the transition at any point along the transition except the arrow or attach points.
Click and drag your pointer to move the transition point to another location.
Only the transition line moves. The arrow and attachment points do not move.
Release the mouse button to specify the transition point location.
The result is a bowed transition line. Repeat the preceding steps to move the transition back into its original shape or into another shape.
You can move the source or end points of a transition to place them in exact locations as follows:
Place your pointer over an attach point until it changes to a small circle.
Click and drag your pointer to move the attach point to another location.
Release the mouse button to specify the new attach point.
The appearance of the transition changes from a solid to a dashed line when you detach and release a destination attach point. Once you attach the transition to a destination, the dashed line changes to a solid line.
The appearance of the transition changes to a default transition when you detach and release a source attach point. Once you attach the transition to a source, the appearance returns to normal.
You can move transition labels to make the Stateflow chart more readable. To move a transition label, do the following:
Click and drag the label to a new location.
Release the left mouse button.
If you mistakenly click and then immediately release the left mouse button on the label, you will be in edit mode for the label. Press the Esc key to deselect the label and try again. You can also click the mouse on an empty location in the chart to deselect the label.
The arrowhead size is a property of the destination object. Changing one of the incoming arrowheads of an object causes all incoming arrowheads to that object to be adjusted to the same size. The arrowhead size of any selected transitions, and any other transitions ending at the same object, is adjusted.
To adjust arrowhead size:
Select the transitions whose arrowhead size you want to change.
Place your pointer over a selected transition and right-click to select Arrowhead Size.
Select an arrowhead size from the menu.
A self-loop transition is a transition whose source and destination are the same state or junction. To create a self-loop transition:
Create the transition by clicking and dragging from the source state or junction.
Press the S key or right-click your mouse to enable a curved transition.
Continue dragging the transition tip back to a location on the source state or junction.
For the semantics of self-loops, see Self-Loop Transitions.
A default transition is a transition with a destination (a state or a junction), but no apparent source object.
Click the Default Transition button in the toolbar and click a location in the drawing area close to the state or junction you want to be the destination for the default transition. Drag your pointer to the destination object to attach the default transition.
The size of the endpoint of the default transition is proportional to the arrowhead size. See Change Transition Arrowhead Size.
Default transitions can be labeled just like other transitions. See Label Default Transitions for an example.
Use the Transition properties dialog box to view and change the properties for a transition. To access the dialog box for a particular transition:
Right-click the transition and select Properties.
The Transition properties dialog box appears.
The following transition properties appear in the dialog box:
Source of the transition; read-only; click the hypertext link to bring the transition source to the foreground.
Destination of the transition; read-only; click the hypertext link to bring the transition destination to the foreground.
Parent of this state; read-only; click the hypertext link to bring the parent to the foreground.
The order in which the chart executes the transition.
The transition's label. See Transition Label Notation for more information on valid label formats.
Textual description or comment.
Enter a Web URL address or a general MATLAB® command. Examples are
After making changes, click one of these buttons:
Apply to save the changes and keep the Transition dialog box open.
Cancel to return to the previous settings for the dialog box.
OK to save the changes and close the dialog box.
Help to display Stateflow online help in an HTML browser window.