| Stateflow User's Guide | ![]() |
Adding and Connecting Junctions
You use junctions to provide alternate paths for transitions. This lets the Stateflow diagram choose the destination state for a transition based on a condition or set of conditions. In this section, you add a junction that chooses between two destination states for a transition based on the value of the temperature. This represents the choice of one of two possible speeds for the device you are controlling, such as a motor.
Place a junction between the two states Hi and Lo and connect it with the following steps:
on_switch as shown.
The transition from the Off state now has two possible destinations: Hi and Lo. To make a choice between these destinations, you need to add a condition to one of the transitions out of the junction in Entering Transition Conditions.
| Deleting, Copying, and Renaming Stateflow Objects | Entering Transition Conditions | ![]() |
© 1994-2005 The MathWorks, Inc.