Debugging
Set breakpoints to stop execution in specific objects, such as charts, states, transitions, graphical functions, truth table functions, local events, and input events. Enable, disable, and set conditions on breakpoints in the Breakpoints and Watch window. Add data that you want to monitor during simulation in the Breakpoints and Watch window. After execution stops at a breakpoint, change data values and step through the simulation.
In addition, during simulation, you can display and change the values of Stateflow® data in the MATLAB® Command Window.
For information on debugging Stateflow chart objects that you execute in MATLAB, see Debug a Standalone Stateflow Chart.
Topics
- Set Breakpoints to Debug ChartsA breakpoint indicates a point at which Stateflow halts the simulation of a chart. 
- Inspect and Modify Data and Messages While DebuggingShows you various ways that you can track the values for Stateflow data and self activity during simulation. 
- Control Chart Execution After a BreakpointA breakpoint indicates a point at which Stateflow halts the simulation of a chart. 
- Use Active State Output to Debug ChartsFind and eliminate errors in Stateflow charts. 
- Detect Modeling Errors During Edit TimeDiscover modeling errors as you design your Stateflow chart. 
- Detect Common Modeling Errors During SimulationFind common modeling errors when you simulate your Stateflow chart. 
- Animate Stateflow ChartsVisually check behavior during simulation by using chart animation. 
- Comment Out Objects in a Stateflow ChartExclude Stateflow objects from simulation. 
- Debug Run-Time Errors in a State Transition TableUse breakpoints to debug state transition tables. 
- Debug a MATLAB Function in a ChartUse breakpoints to debug MATLAB functions. 
- Debug Errors in a Truth TableUse breakpoints to debug truth tables. 
- Resolve Unintended Recursive BehaviorTroubleshoot warnings caused by unwanted recursive behavior. 
- Model and Debug a DC Motor in StateflowUse continuous-time semantics to model a permanent magnet DC motor.