Stateflow User's Guide Previous page   Next Page

Simulating a Subchart

In Converting a State to a Subchart, you edit a Stateflow diagram to turn the superstate On into a subchart and add substates to it. Observe the behavior of the subchart On and its substates during simulation of the Stateflow diagram in the SFcontrol7 model in the following steps:

  1. Start the simulation and change the value of the input data temp to 90.

    When simulation starts, the first temp event updates the diagram and the state Off is entered.

  2. Send an on_switch event with the manual switch.


  3. Double-click the On state.
  1. This opens the subchart On to expose the activity of its child states.


  1. Change the input value for temp to take the transitions between the states No, Lo, and Hi.
  2. Send an off_switch event with the Manual Switch block.

    The active substate On exits.

  3. Click the Up to Controller tool .

    The transition from the On state is taken to the Off state, and the Off state becomes active.


Previous page  Converting a State to a Subchart Controlling Objects with Parallel Superstates Next page

© 1994-2005 The MathWorks, Inc.