| Using Stateflow | Search  Help Desk |
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 "Naming States" ), if unnamed, then check the Output State Activity checkbox on the state's property dialog (see "Using the State Properties Dialog"). 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 "Defining Output Data" for more information. Note