| Stateflow User's Guide | ![]() |
Outputting State Activity to Simulink
Stateflow allows a chart to output the activity of its states to Simulink via a data port on the state's Chart block. To enable output of a particular state's activity, first name the state (see Entering the Name), if unnamed, then select the Output State Activity check box on the state's property dialog (see Changing State Properties). Stateflow creates a data output port on the Chart block containing the state. The port has the same name as the state. Stateflow also adds a corresponding data object of type State to the Stateflow data dictionary. During simulation of a model, the port outputs 1 at each time step in which the state is active; 0, otherwise. Attaching a scope to the port allows you to monitor a state's activity visually during the simulation. See Sharing Input and Output Data with Simulink for more information.
| Labeling States | Creating Transitions in Stateflow Charts | ![]() |
© 1994-2005 The MathWorks, Inc.