Main Content

Simulation Stepping Options

Enable stepping back and configure number of time steps to move when stepping through simulation

Description

You can use the Step Forward and Step Back buttons to step through major time steps of a simulation to analyze and debug models. Use the Simulation Stepping Options dialog box to configure how many major time steps the simulation moves when you click Step Forward or Step Back and to enable stepping back. You can step backward in time in a simulation only after you enable stepping back using the Simulation Stepping Options.

You can adjust the simulation stepping options during simulation to balance simulation performance against the granularity of steps based on the runtime behavior of the system. For more information, see How Stepping Through Simulation Works.

Rapid accelerator simulations do not support stepping forward or backward. To step through a simulation, use normal or accelerator mode.

Simulation Stepping Options dialog box

Open the Simulation Stepping Options

  • Simulink® Toolstrip: On the Simulation tab or the Debug tab, click the Step Back button.

  • Simulink Toolstrip: On the Simulation tab or the Debug tab, click the Step Back button arrow and select Configure Simulation Stepping.

Parameters

expand all

Select this option to enable stepping backward as well as forward in time during simulation. When you select this option, you can configure how the software saves data during simulation to support stepping back.

Specify how many simulation snapshots to save to support stepping back. A simulation snapshot contains all the information required to restore the state of the simulation.

Simulation snapshots are stored in memory and are not accessible in the workspace during or after simulation. Saving more snapshots increases the amount of memory the simulation uses and can slow the speed of the simulation.

Dependencies

To enable this parameter, select Enable stepping back.

Specify the number of major time steps between each simulation snapshot the software saves to support stepping back.

Dependencies

To enable this parameter, select Enable stepping back.

Specify the number of major time steps to step through each time you press the Step Forward or Step Back button.

Tips

  • To inspect signal values while stepping through the simulation, display port value labels on signals. Select a signal. Then, on the Debug tab, under Tools, in the Output Values button group, click Show Output Value of selected signal .

  • To start stepping through a normal or accelerator mode simulation that is already running, pause the simulation. Then, use the Step Forward and Step Backward buttons.

  • To start stepping from a specific time within a simulation, specify a pause time. On the Debug tab, under Breakpoints, specify the Pause Time in seconds. When you start the simulation by clicking Run, the simulation runs until the specified time and pauses. From there, you can step through the simulation.

  • To debug the behavior of a model around a point of interest, you can add a signal breakpoint and specify the condition such that the simulation pauses at the time of interest. Then, use the Step Forward and Step Backward buttons. For more information about setting breakpoints in your model, see Breakpoints List.

  • The stepping and breakpoint options in the Simulink Editor do not have a programmatic equivalent available in the software. The Simulink debugging programmatic interface includes options for setting breakpoints and stepping through simulations. However, the behavior of these functions is not identical to the behavior of the stepping options in the Simulink Editor. For more information about programmatic debugging, see Simulink Debugging Programmatic Interface.

Version History

Introduced in R2012b

expand all