You can analyze the behavior of your system by simulating your model. You can run what-if scenarios by restarting the simulation from any saved state and analyzing its reaction to different settings and configurations.
In Stateflow you can visualize system behavior during simulation by using state diagram animation to highlight the active states and transitions in your model.
Stateflow debugging capabilities let you step through the simulation in detail. You can set breakpoints, monitor data values, and step through different functions in your state diagrams. From the Stateflow debugger window, you can control the simulation execution and display the diagram's call stack and execution status.
The Stateflow debugger detects run-time errors, including state inconsistencies, data range violations, and potential infinite loops.
During simulation you can visualize the simulation results by:
Alternatively, you can log diagram and state activity data for post-processing in MATLAB.