Main Content

Simulink.sdi.getArchiveRunLimit

Get limit for number of runs to retain in Simulation Data Inspector archive

Description

example

limit = Simulink.sdi.getArchiveRunLimit returns the limit on the number of runs the Simulation Data Inspector retains in the archive. A return of -1 indicates no limit on the number of runs.

When you run multiple simulations in a single MATLAB® session, the Simulation Data Inspector retains results from each simulation so you can analyze the results together. Use the Simulation Data Inspector archive to manage the number of runs the Simulation Data Inspector retains and to visually manage runs in the user interface.

Tip

To automatically limit the number of runs, configure the Simulation Data Inspector to automatically move prior runs into the archive using the Simulink.sdi.setAutoArchiveMode function and specify the archive run limit.

For information about how to control the amount of data logged from simulation, see Limit the Size of Logged Data.

Examples

collapse all

You can configure the Simulation Data Inspector to retain only the logged data for your current simulation. In iterative design and debugging workflows, this configuration helps prevent accumulation of unwanted logged data on disk.

First, check the configuration of the Simulation Data Inspector archive. Save the archive preference values to restore your preferences after you finish designing or debugging.

limit = Simulink.sdi.getArchiveRunLimit;
mode = Simulink.sdi.getAutoArchiveMode;

Configure the Simulation Data Inspector to automatically move runs into the archive. Then, set the archive run limit to 0.

Simulink.sdi.setAutoArchiveMode(true)
Simulink.sdi.setArchiveRunLimit(0)

When you simulate your model, the Simulation Data Inspector deletes the previous run and updates the view to show signals from the current simulation.

When you finish designing or debugging your model, you can restore the Simulation Data Inspector archive back to the previous configuration.

Simulink.sdi.setArchiveRunLimit(limit)
Simulink.sdi.setAutoArchiveMode(mode)

Output Arguments

collapse all

Maximum number of runs to store in Simulation Data Inspector archive, returned as a numeric scalar. A value of -1 indicates no limit on the number of runs to retain in the archive.

Version History

Introduced in R2018b