Main Content

Simulink.sdi.setAutoArchiveMode

Specify how Simulation Data Inspector manages simulation runs

Description

Simulink.sdi.setAutoArchiveMode(archive) configures the Simulation Data Inspector to manage simulation runs according to archive.

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.

With automatic archiving enabled, when you start a simulation, the Simulation Data Inspector moves the prior run into the archive. In the user interface, prior runs automatically move into the collapsible Archive pane, and plots automatically update to show data from the current simulation.

With automatic archiving disabled, the Simulation Data Inspector does not move runs to the archive or automatically update plots.

Tip

When you enable automatic archiving and specify an archive run limit, the Simulation Data Inspector automatically manages the number of runs it retains. Once the number of runs reaches the specified limit, the Simulation Data Inspector deletes runs from the archive on a first-in, first-out basis.

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

example

Examples

collapse all

Configure the Simulation Data Inspector to automatically move prior simulation runs into the archive.

Simulink.sdi.setAutoArchiveMode(true)

Specify the number of runs to retain in the Simulation Data Inspector by setting the archive run limit. For example, specify the archive run limit as 5 to only retain five prior runs in addition to the current run.

Simulink.sdi.setArchiveRunLimit(5)

The Simulation Data Inspector automatically moves prior runs into the archive. Once the archive contains five runs, the Simulation Data Inspector deletes run data from the archive on a first-in, first-out basis.

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 the 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 to the previous configuration.

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

Input Arguments

collapse all

Whether Simulation Data Inspector manages runs using archive, specified as logical true (1) or false (0).

Data Types: logical

Version History

Introduced in R2018b