Main Content

Simulation Stepper Limitations


  • There is no command-line interface for Simulation Stepper.

Model Configuration

  • Simulation stepping (forward and backward) is available only for Normal and Accelerator modes.

  • The step back capability relies on the model operating point for saving and restoring the state of a simulation. As a result, the step back capability is available only for models that support saving the model operating point. For more information, see Use Model Operating Point for Faster Simulation Workflow.

  • Simulation Stepper steps through the major time steps of a simulation without changing the course of a simulation. Choosing a refine factor greater than unity produces loggable outputs at times between the major time steps of the solver. These times are not major time steps, and you cannot step to a model state at those times.

  • If you run a simulation with stepping back enabled, the Simulink® software checks whether the model can step back. If it cannot, a warning appears at the MATLAB® command prompt. For some simulations, Simulink cannot step back. The step back capability is then disabled until the end of that simulation. Then the setting resets to the value you requested.

  • When you place custom code in Configuration Parameters > Simulation Target > Custom Code > Initialize function in the Model Configuration Parameters dialog box, this gets called only during the first simulation in Simulation Stepper.


  • Some blocks do not support stepping back for reasons other than model operating point support. These blocks are:

    • S-functions that have P-work vectors but do not declare their model operating point compliance level or declare it to be unknown or disallowed. For more information, see S-Function Compliance with the ModelOperatingPoint.

    • Simscape™ Multibody™ First Generation blocks

    • Legacy (pre-R2016a) SimEvents® blocks

  • MATLAB Function blocks generally support stepping back. However, the use of certain constructs in the MATLAB code of these blocks can prevent the block from supporting stepping back. These scenarios prevent the MATLAB Function blocks from stepping back:

    • Persistent variables of opaque data type. Attempts to step back under this condition cause an error message based on the specific variable type.

    • Extrinsic functions calls that can contain state (such as properties of objects or persistent data of functions). No warnings or error messages appear, but the result likely will be incorrect.

    • Calls to custom C code (through MEX function calls) that do not contain static variables. No warnings or error messages appear, but the result likely will be incorrect.

  • Some visualization blocks do not support stepping back. Because these blocks are not critical to the state of the simulation, no errors or warnings appear when you step back in a model that contains these blocks:

    • Auto Correlator

    • Cross Correlator

    • Spectrum Analyzer

    • Averaging Spectrum Analyzer

    • Power Spectral Density

    • Averaging Power Spectral Density

    • Floating Bar Plot

    • 3Dof Animation

    • MATLAB Animation

    • VR Sink

    • Any blocks that implement custom visualization in their output method (for example, an S-function that sends output to a MATLAB figure) are not fully supported for stepping back because the block method Output does not execute while stepping back. While the state of such blocks remains consistent with the simulation time (if the blocks comply with model operating point), the visualization component is inconsistent until the next step forward in the simulation.

    Because these blocks do not affect the numerical result of a simulation, stepping back is not disabled for these blocks. However, the values these blocks output are inaccurate until the simulation steps forward again.

Related Examples

More About