| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Stateflow |
| Contents | Index |
| Learn more about Stateflow |
| On this page… |
|---|
Smart transitions attach their ends to the surfaces of Stateflow objects and maintain their shapes and uniqueness when you rearrange chart objects.
By default, new transitions have smart behavior, on the assumption that this behavior is desirable in most circumstances. You can disable or enable smart behavior in existing transitions with the following steps:
On the resulting menu, observe the selection titled Smart. If a check mark appears in front of Smart, the transition has smart behavior.
If no check mark appears for Smart, select it to enable smart behavior.
To disable smart transition behavior, select Smart so that no check mark appears.
Note Transitions with smart behavior differ graphically only. Apart from graphical behavior, there is no difference in meaning between a transition with and without smart behavior. |
The following topics discuss some of the behaviors of smart transitions:
In the following example, state B is attached to state A by a smart transition. The example shows state B as you drag it counterclockwise around the upper right corner of state A. During this process, state B turns to its selection color and the transition turns to a light shade of gray. The arrows show the dragging direction.
1
| 2
| 3
|
4
| 5
| 6
|
The following behavior applies to the preceding example:
The first capture shows states A and B at the beginning of movement.
As B moves upward, the back end of the transition slides upward on A, keeping the transition straight.
As B moves around the corner of A, the back end of the transition suddenly hops around the upper right-hand corner of A. The transition appears curved from the top surface of A to the left side of B. This shape maintains perpendicularity with each attached state side.
As B moves on top of A, the transition stays curved but its front end slides down to the lower left-hand corner of B.
As B continues to move to the left over A, the front end of the transition hops around the lower left-hand corner of B.
Finally, as B moves directly over A, the front end of the transition slides over the bottom edge of B.
As B continues to circle A, steps 1 through 6 repeat for each remaining side of A.
While smart transitions allow their ends to slide around surfaces of connected objects, they also try to maintain their original shape during moving. In the following example, a pair of transitions with smart behavior slide during a resizing to maintain their original shape.
1
| 2
| 3
|
In the following example, the ends of a pair of transitions with smart behavior originate from a junction and terminate in a state. As the junction moves around the state, the ends slide around the state and maintain the same relative spacing between each other. The arrows indicate the direction of movement.
1
| 2
| 3
|
Straight-line connections to states must be in one of four directions: left, right, up, or down. To maintain their straightness, smart transitions from junctions always seek to connect to a state through equivalent locations on the junction (left, right, top, bottom). In the following example, a junction connects to two states, A and B. Watch the behavior of two straight smart transitions as the junction moves to different locations.
1
| 2
| 3
|
4
| 5
| 6
|
The junction starts with two straight smart transition connections to states A and B.
The junction connects to state A through its left side. Since the junction is below A, only a curved connection is possible.
State B could be connected by a straight line through the junction's left side, but this is already occupied by the connection to A. Therefore, B is connected through the junction's bottom, and must be curved.
The junction connects to B by a straight transition through the junction's top connection. No straight-line connection to A is possible, therefore the junction is connected to state A with a curved transition through its left side.
At this location (under A, to the left of B), straight-line transitions to A and B are possible from the junction's top and right connection points, respectively.
At the location left of state A, the junction connects to state B through its right connection point. Since the junction is above B, only a curved connection is possible.
Above A, a straight-line transition to state A is possible through the junction's bottom connector. A straight-line connection to state B is not possible, so the junction is connected to state B through a curved transition from its right connection.
Junctions that are connected to other junctions with smart transitions will snap to an invisible grid consisting of horizontal and vertical lines that pass through the center of each junction. The following example depicts this behavior.
1
| 2
| 3
|
Here, the invisible grid is depicted for each of the three junctions by dashed vertical and horizontal lines. Each junction is connected to each other through nonlinear smart transitions:
In the first scene, the snap grid for each junction does not overlap. The arrow indicates that junction A is being moved toward the vertical snap line for junction B.
When A is within a very small distance of B's snap line, A snaps into position directly above B and centered in its vertical snap line. The arrow indicates that A is now being moved toward the horizontal snap line for junction C.
When A is within a very small distance of C's horizontal snap line, A snaps into position directly to the side of C and centered in its horizontal snap line.
Transitions with smart behavior bow symmetrically between junctions. In the following examples, transitions with smart behavior are drawn between two junctions:
1
| 2
| 3
|
In the first case, a transition originates at the junction on the left and terminates on the left side of the right junction. This results in a straight line.
In the second case, a transition originates at the junction on the left and terminates on the top of the right junction. This results in a transition line bowed up.
In the third case, a transition originates at the junction on the left and terminates on the right side of the right junction. This results in a transition line bowed up even more.
Bowed smart transitions maintain symmetry by maintaining equality between transition entry and exit angles, as shown.

You can bow a smart transition between two junctions to any degree. Place your pointer anywhere on the transition (except end points) and click and drag in a direction perpendicular to a straight line connecting the two junctions. You can move the mouse in any direction to bow the transition but only the component perpendicular to the straight line applies.
Disabling smart behavior for a transition allows you to distort the transition asymmetrically (see Nonsmart Transitions Distort Asymmetrically). However, if you enable smart behavior again, the transition returns to its previous bowed shape.
Transitions with smart behavior prefer straight lines coming from junctions. In the following example, the terminating junction moves in a radial direction around another junction.
1
| 2
| 3
|
The smart transition maintains a straight line, because the end on the originating junction follows the tip of the transition.
The following topics describe some of the behavior exhibited by transitions without smart behavior.
You can disable and enable smart behavior in transitions. See the section Setting Smart Behavior in Transitions.
Contrast the example in the section Smart Transitions Slide Around Surfaces with the following example.
1
| 2
| 3
|
4
| 5
| 6
|
A nonsmart transition connects state A to state B. The pointer appears over state B and clicks and drags to new locations counterclockwise around A. During this process, state B turns to its highlight color but the transition remains unchanged, a sign of a nonsmart transition.
As B moves around A, the transition changes into a distorted curve that maintains the original attachment points. These points remain unchanged in position, although the angle of attachment is always perpendicular to the side of the state.
By clicking and dragging on different locations along a nonsmart transition, you can reshape it into an asymmetric curve suited to your needs. Consider the following example:
1
| 2
| 3
|
For this example, use the following procedure:
Right-click the transition and select Smart from the resulting shortcut menu to disable smart behavior.
![]() | Using Supertransitions to Extend Transitions | Using Graphical Functions to Extend Actions | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |