Contents

Simulink.sdi.setRunOverwrite

Mark simulation run for overwrite

Syntax

Simulink.sdi.setRunOverwrite(runID,overwrite)

Description

Simulink.sdi.setRunOverwrite(runID,overwrite) marks a run identified by runID for overwriting in the Simulation Data Inspector with the next simulation run.

Input Arguments

runID

Run ID, a unique number identifying a run in the Simulation Data Inspector.

Output Arguments

overwrite

Boolean value. When set to true, the next simulation overwrites the run.

Examples

expand all

Mark Run for Overwriting

This example shows how to mark a run for overwriting in the Simulation Data Inspector.

Open sldemo_fuelsys.

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 for overwriting.

Simulate sldemo_fuelsys.

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

Alternatives

In the Simulation Data Inspector, click a run in the Runs pane and then click Overwrite from the Visualize tab.

Was this topic helpful?