Documentation

Step Through a Simulation

Step Forward and Back

This example shows how to step forward and back through a simulation.

  1. At the MATLAB®prompt, type

    vdp
  2. In the Simulink®Editor for thevdp模型中,点击to open the Simulation Stepping Options dialog box.

  3. In the dialog box, select theEnable stepping backcheck box, and then clickOK.

  4. In the Simulation toolbar, click theStep Forwardbuttonone time.

    The simulation simulates one step, and the software stores a simulation snapshot for that step.

  5. Click the Step Forward button again to step forward again and store simulation data. A total of 25 forward steps produces these simulation results:

  6. 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.

Related Examples

More About

Was this topic helpful?