| Stateflow® | ![]() |
| On this page… |
|---|
Changing Transition Arrowhead Size |
Use the following procedure for creating 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.
Notice that the source of the transition sticks to the initial source point for the transition.
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.
Newly created transitions have smart behavior. See Setting Smart Behavior in Transitions.
To delete a transition, select it and choose Cut from the Edit menu, or press the Delete key.
See the following sections for help with creating self-loop and default transitions:
While creating a transition, notice that the source of the transition sticks to the initial source point. This often results in a curved transition. To create a perfectly straight transition, while clicking and dragging from one state to another, do one of the following:
Press the S key (works on all platforms).
Right-click the mouse (works on most platforms).
Either of these actions straightens the transition perpendicular to the transition's source state or junction surface, if possible, and allows the transition source point to slide to maintain straightness. For states, if your pointer is out of range of perpendicularity with the source state, the transition is unaffected.
Transition labels contain Stateflow® action language that accompanies the execution of a transition. Creating and editing transition labels is described in the following topics:
For more information on transition concepts, see Transition Label Notation.
For more information on transition label contents, see Using Actions in Stateflow® Charts.
Label unlabeled transitions as follows:
Select (left-click) the transition.
The transition turns 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.
Transition labels have the following general format:
event [condition]{condition_action}/transition_action
Specify, as appropriate, relevant names for event, condition, condition_action, and transition_action.
Label Field | Description |
|---|---|
event | Event that causes the transition to be evaluated. |
condition | Defines what, if anything, has to be true for the condition action and transition to take place. |
condition_action | If the condition is true, the action specified executes and completes. |
transition_action | This action executes after the source state for the transition is exited but before the destination state is entered. |
Transitions do not have to have labels. You can specify some, all, or none of the parts of the label. Valid transition labels are defined by the following:
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. See Setting Smart Behavior in Transitions for a description of smart and nonsmart transition behavior.
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.
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:
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 Stateflow Editor 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 from the Transition shortcut menu:
Select the transitions whose arrowhead size you want to change.
Place your pointer over a selected transition and right-click to display the shortcut menu.
A menu of arrowhead sizes appears.
To adjust arrowhead size from the Junction shortcut menu:
Select the junctions whose incoming arrowhead size you want to change.
Place your pointer over a selected junction and right-click.
In the resulting submenu, place your pointer over Arrowhead Size.
A menu of arrowhead sizes appears.
A self-loop transition is a transition whose source and destination are the same state or junction.
The following is an example of a self-loop transition:

To create a self-loop transition, follow these steps:
Create the transition as usual by clicking and dragging it out from the source state or junction.
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. See Default Transitions for an explanation of default transitions.
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 Changing Transition Arrowhead Size.
Default transitions can be labeled just like other transitions. See Labeling Default Transitions for an example.
Use the Transition dialog box to view and change the properties for a transition. To access the Transitions dialog for a particular transition, follow these steps:
Right-click on the transition.
A shortcut pop-up menu appears.
Choose Properties from the shortcut menu.
The Transition dialog for the transitions appears as shown.

The following table lists and describes the properties displayed for a transition in its Transition dialog:
Field | Description |
|---|---|
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. | |
Select the check boxes to set debugging breakpoints either when the transition is tested for validity or when it is valid. | |
The order in which the transition is executed. | |
The transition's label. See Transition Label Notation for more information on valid label formats. | |
Textual description/comment. | |
Enter a Web URL address or a general MATLAB® command. Examples are www.mathworks.com, mailto:email_address, and edit/spec/data/speed.txt. |
After making changes, select one of these options:
Apply to save the changes and keep the Transition dialog open.
Cancel to return to the previous settings for the dialog
OK to save the changes and close the dialog box
Help to display Stateflow online help in an HTML browser window.
![]() | Working with States in Stateflow® Charts | Creating Flow Graphs with Connective Junctions | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |