| Stateflow® | ![]() |
| On this page… |
|---|
Drawing a Supertransition Into a Subchart |
A supertransition is a transition between different levels in a chart, for example, between a state in a top-level chart and a state in one of its subcharts, or between states residing in different subcharts at the same or different levels in a chart. You can create supertransitions that span any number of levels in your chart, for example, from a state at the top level to a state that resides in a subchart several layers deep in the chart.
The point where a supertransition enters or exits a subchart is called a slit. Slits divide a supertransition into graphical segments. For example, the following chart shows two supertransitions as seen from the perspective of a subchart and its parent chart, respectively.

In this example, supertransition t1 goes from state A in the parent chart to state C in the subchart and supertransition t2 goes from state C in the subchart to state B in the parent chart. Note that both segments of t1 and t2 have the same label.
Use the following steps to draw a supertransition from an object outside a subchart to an object inside the subchart.
Caution You cannot undo the operation of drawing a supertransition. When you perform this operation, the undo and redo buttons are disabled from undoing and redoing any prior operations. |
Position your pointer over the border of the state.
The pointer assumes the crosshairs shape.

Dragging the mouse causes a supertransition segment to appear. The segment looks like a regular transition. It is curved and is tipped by an arrowhead.

Drag the segment's tip anywhere just inside the border of the subchart.
The arrowhead now penetrates the slit.

If you are not happy with the initial position of the slit, you can continue to drag the slit around the inside edge of the subchart to the desired location.
Continue dragging your pointer toward the center of the subchart.
A wormhole appears in the center of the subchart.

A wormhole allows you to open a subchart while drawing a supertransition.
Drag your pointer over the center of the wormhole.
The subchart opens. Now the wormhole and supertransition are visible inside the subchart.

Drag and drop the tip of the supertransition anywhere on the border of the object that you want to terminate the transition.

Note If the terminating object resides within a subchart in the current subchart, continue to drag the tip of the supertransition through the wormhole of the inner subchart and complete the connection inside the inner chart. In this way, you can draw a supertransition to an object at any subchart depth in the chart. |
Use the following steps to draw a supertransition out of a subchart.
Caution You cannot undo the operation of drawing a supertransition. When you perform this operation, the undo and redo buttons are disabled from undoing and redoing any prior operations. |
Draw an inner transition segment from the source object anywhere just outside the border of the subchart
A slit appears as shown.

Keep dragging the transition away from the border of the subchart.
A wormhole appears.

Drag the transition down the wormhole.
The parent of the subchart appears.


Note If the parent chart is itself a subchart and the terminating object resides at a higher level in the subchart hierarchy, you can continue drawing by dragging the supertransition into the border of the parent subchart. This allows you to continue drawing the supertransition at the higher level. In this way, you can connect objects separated by any number of layers in the subchart hierarchy. |
A supertransition is displayed with multiple resulting transition segments for each layer of containment traversed. For example, if you create a transition between a state outside a subchart and a state inside a subchart of that subchart, you create a supertransition with three segments, each displayed at a different containment level.
You can label any one of the transition segments constituting a supertransition using the same procedure used to label a regular transition (see Labeling Transitions). The resulting label appears on all the segments that constitute the supertransition. Also, if you change the label on any one of the segments, the change appears on all segments.
![]() | Using Subcharts to Extend Charts | Extending Transitions with Smart Behavior | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |