This example shows how to step forward and back through a simulation.
At the MATLAB® prompt, type
In the Simulink® Editor for the
to open the Simulation
Stepping Options dialog box.
In the dialog box, select the Enable previous stepping check box, and then click OK.
In the Simulation toolbar, click the Step Forward button .
The simulation simulates one step, and the software stores a simulation snapshot for that step.
Click the Step Forward button again to step forward again and store simulation data. When you view the results of the simulation, 25 clicks plots this data:
In the Simulation toolbar, click the Step Back button one or more times to step backward to the simulation snapshot of the previous step.
You must step forward before you can step backward to create the simulation state that the step backward operation requires.
The scope updates to reflect the step back.