| Stateflow® | ![]() |
| On this page… |
|---|
Default Transition in Exclusive (OR) Decomposition Example Default Transition to a Junction Example |
This example shows a transition from an OR state to a superstate with exclusive (OR) decomposition, where a default transition to a substate is defined.

Initially, the Stateflow® chart is asleep. State A is active. Event E_one occurs and awakens the chart. Event E_one is processed from the root of the chart down through the hierarchy of the chart:
The Stateflow chart root checks to see if there is a valid transition as a result of E_one. There is a valid transition from state A to superstate B.
This sequence completes the execution of this Stateflow chart associated with event E_one when state A is initially active.
The following example shows the behavior of a default transition to a connective junction.

Initially, the Stateflow chart is asleep. State B.B1 is active. An event occurs and awakens the chart. Condition [C_two] is true. The event is processed from the root of the chart down through the hierarchy of the chart:
This sequence completes the execution of this Stateflow chart associated with the occurrence of any event.
This example shows the behavior of a superstate with a default transition and a history junction.

Initially, the Stateflow chart is asleep. State A is active. There is a history junction and state B4 was the last active substate of superstate B. Event E_one occurs and awakens the chart. Event E_one is processed from the root of the chart down through the hierarchy of the chart:
The Stateflow chart root checks to see if there is a valid transition as a result of E_one.
There is a valid transition from state A to superstate B.
State B uses the history junction to determine the substate destination of the transition into the superstate.
The history junction indicates that substate B.B4 was the last active substate, which becomes the destination of the transition.
This sequence completes the execution of this Stateflow chart associated with event E_one.
This example shows the use of a default transition with a label.

Initially, the Stateflow chart is asleep. State A is active. Event E_one occurs, awakening the chart. Event E_one is processed from the root of the chart down through the hierarchy of the chart with the following steps:
The Stateflow chart root checks to see if there is a valid transition as a result of E_one.
There is a valid transition from state A to superstate B. The transition is valid if event E_one or E_two occurs.
State B detects a valid default transition to state B.B1. The default transition is valid as a result of E_one.
This sequence completes the execution of this Stateflow chart associated with event E_one when state A is initially active.
![]() | Condition Action Examples | Inner Transition Examples | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |