Documentation

Simulink.sdi.setRunOverwrite

Enable overwrite run mode for a Simulation Data Inspector run

Syntax

Simulink.sdi.setRunOverwrite(runID,overwrite)

Description

example

Simulink.sdi.setRunOverwrite(runID,overwrite) enables overwrite run mode for the run identified by runID in the Simulation Data Inspector.

Examples

collapse all

This example shows how to enable overwrite run mode for a run in the Simulation Data Inspector.

Open the sldemo_fuelsys model.

On the Simulink® Editor toolbar, click the Simulation Data Inspector button arrow and select Send Logged Workspace Data to Data Inspector.

Simulate the model.

Open the Simulation Data Inspector.

At the MATLAB® Command Window, create a runID variable that uses the value of the Run ID for a run. You can find the Run ID for a run using the function Simulink.sdi.getRunIDByIndex.

runID = 1;

Set the overwrite condition to true.

Simulink.sdi.setRunOverwrite(runID,true);  
In the Simulation Data Inspector, you can see the run is now marked to overwrite during the next simulation.

Simulate sldemo_fuelsys.

In the Simulation Data Inspector, the new simulation data replaces the previous run.

Input Arguments

collapse all

Run ID, a unique number identifying a run in the Simulation Data Inspector, specified as an integer.

Overwrite run setting, specified as true or false. When set to true, the subsequent simulations overwrite the run identified by the runID.

Example: Simulink.sdi.setRunOverwrite(1, true);

Alternatives

You can set and disable run overwrite mode from the right-click context menu for the run in the Simulation Data Inspector UI. For more information see Iterate Model Design with the Simulation Data Inspector.

Introduced in R2011b

Was this topic helpful?