Stateflow User's Guide Previous page   Next Page

Watching Stateflow Execute During Simulation

Once you finish a Simulink model with a Stateflow block, you can simulate it. During simulation, Stateflow animates its Stateflow diagrams to show you how it responds to events, takes transitions, and changes states. In the animated diagram, active states are highlighted, as shown in the following example:

When events occur and transitions are taken, they too are highlighted. Continuing with the previous example, the following figures show what happens when an on_switch event occurs and the value of temp is less than 30:

  1. The transition to the junction is taken.

  2. Because temp is less than 30, the transition to the On state is taken.

  3. The Off state is exited; the On state is entered, becomes active, and stays active.


Previous page  Stateflow Uses Data Variables Generating C Code for Targets Next page

© 1994-2005 The MathWorks, Inc.