Stateflow User's Guide Previous page   Next Page

Label Format for a State-to-State Transition Example

The following example shows the general label format for a transition entering a state:

Execution of the above transition occurs as follows:

  1. When an event occurs, state S1 checks for an outgoing transition with a matching event specified.
  2. If a transition with a matching event is found, the condition for that transition ([condition]) is evaluated.
  3. If the condition condition evaluates to true, the condition action condition_action ({condition_action}) is executed.
  4. If the destination state is determined to be a valid destination, the transition is taken.
  5. State S1 is exited.
  6. The transition action transition_action is executed when the transition is taken.
  7. State S2 is entered.

Previous page  Transitions to and from Exclusive (OR) States Examples Transitioning from State to State with Events Example Next page

© 1994-2005 The MathWorks, Inc.