Documentation Center

  • Trial Software
  • Product Updates

Speed Up Simulation

Disable Simulation Target Options That Impact Execution Speed

To simulate your model more quickly, disable options as described in the steps that follow:

  1. Open the Model Configuration Parameters dialog box and select the Simulation Target pane.

  2. Clear any of these options:

    • Enable debugging/animation — Clear this check box to disable chart animation and debugging.

      This option enables automatically when you use the Stateflow® Debugger to start a model simulation. You can also control chart animation separately in the Debugger. (The Stateflow Debugger works only with simulation targets. Therefore, you cannot generate debugging/animation code for embeddable targets, even if you enable this option.)

    • Enable overflow detection (with debugging) — Clear this check box to disable overflow detection of Stateflow data in the generated code. Overflow occurs for data when a value is assigned to it that exceeds the numeric capacity of its type.

    • Echo expressions without semicolons — Clear this check box to disable run-time output in the MATLAB® Command Window, such as actions that do not terminate with a semicolon.

  3. Click OK.

Keep Charts Closed During Simulation

During model simulation, any open charts with animation enabled take longer to simulate. If you keep all charts closed, you can speed up the simulation.

Keep Scope Blocks Closed During Simulation

During model simulation, any open Scope blocks continuously update their display. If you keep all Scope blocks closed, you can speed up the simulation. After the simulation ends, you can open the Scope blocks to view the results.

Use Library Charts in Your Model

When your model has multiple charts that contain the same elements, you might generate multiple copies of identical simulation code. By using library charts, you can minimize the number of copies of identical simulation code. For example, using five library charts reduces the number of identical copies from five down to one.

For more information about using library charts, see Create Specialized Chart Libraries for Large-Scale Modeling.

Was this topic helpful?