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
Open the model
In the Simulink® Editor, click the
gearsignal. 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.
shift_logicchart 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.
selection_statestate, select the
downshiftingsubstate. Then, in the Simulation tab, click Log Self Activity.
Repeat the previous step for the
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).
Simulation Data Inspector (Simulink)