This example shows how to step forward and back through a simulation.
At the MATLAB® prompt, type
In the Simulink® Editor for the
click to open the Simulation
Stepping Options dialog box.
In the dialog box, select the Enable stepping back check box, and then click OK.
In the Simulation toolbar, click the Step Forward button one time.
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. A total of 25 forward steps produces these simulation results:
You must step forward to create the simulation state that the step backward operation requires. This means you must first step forward before you can step backward through the same steps.
In the Simulation toolbar, click the Step Back button four times to step backward to the simulation snapshot shown below.