View State Activity by Using the Simulation Data Inspector
You can use the Simulation Data Inspector (Simulink) to log state activity and data for your Stateflow® chart. With the Simulation Data Inspector, you can view and compare:
Data from your chart
Child and leaf state activity for your chart
Self, child, and leaf state activity for your states
Add Signals and States for Logging
In this example, you use the Simulation Data Inspector to monitor the active state
data for the Stateflow chart in the model sf_car
.
Open the model
sf_car
.openExample("sf_car")
In the Simulink® Editor, click the
gear
signal. Then, in the Simulation tab, select Log Signals.The logging badge appears above the signal to indicate that the data from the signal is logged when you run the model.
Open the
shift_logic
chart by clicking the arrow in the bottom-left corner of the block.Select the state
gear_state
. Then, in the Simulation tab, click Log Child Activity. The logging badge appears in the corner of the state.In the
selection_state
state, select thedownshifting
substate. Then, in the Simulation tab, click Log Self Activity.Repeat the previous step for the
upshifting
substate.
View Logged Output in Simulation Data Inspector
Simulate the model.
In the Simulation tab, under Review Results, select Data Inspector . When you simulate the model, the icon is highlighted to indicate that the Simulation Data Inspector has new simulation data.
In the Simulation Data Inspector, under Visualizations and Layouts, select the four-plot grid layout. Then, in the Inspect pane, select a signal for each plot. For more information, see Inspect Simulation Data (Simulink).
See Also
Simulation Data Inspector (Simulink)