Step Through a Simulation
Step Forward and Back
This example shows how to step forward and back through a simulation.
At the MATLAB®prompt, type
vdp
In the Simulink®Editor for the
vdp
模型中,点击to open the Simulation Stepping Options dialog box.In the dialog box, select theEnable stepping backcheck box, and then clickOK.
In the Simulation toolbar, click theStep Forwardbuttonone 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 theStep Backbuttonfour times to step backward to the simulation snapshot shown below.