Contenuto principale

Simulink.sdi.copyRun

R2026b

Copy Simulation Data Inspector run

Description

newRunID = Simulink.sdi.copyRun(runID) copies the run corresponding to runID and returns the run ID for the new run. The new run includes all the simulation data and metadata from the original run. You can modify the copy of the run by adding or deleting signals and metadata while still retaining the original run.

[newRunID,newRunIndex] = Simulink.sdi.copyRun(runID) also returns the run ID for the new run.

[newRunID,newRunIndex,signalIDs] = Simulink.sdi.copyRun(runID) also returns the signal IDs for the signals in the new run.

example

Examples

collapse all

Create a copy of a Simulation Data Inspector run that includes only the first two signals from the original run.

Copy the run. Then, delete all but the first two signals.

[truncRunID,truncRunIdx,truncSigIDs] = Simulink.sdi.copyRun(myLargeRunID);
count = length(trunkRunSignalIDs);
for idx = 3:count
    Simulink.sdi.deleteSignal(trunkRunSignalIDs(idx))
end

Verify the number of signals in the new, truncated run.

truncRunObj = Simulink.sdi.getRun(truncRunID);
truncRunObj.SignalCount
ans = int32
2

Input Arguments

collapse all

Run identifier for the run you want to copy, specified as a positive integer. The Simulation Data Inspector assigns run IDs when it creates runs. To access a run ID, use Simulink.sdi.getAllRunIDs or Simulink.sdi.getRunIDByIndex.

Output Arguments

collapse all

Copied run ID, returned as a positive integer.

Copied run index in the Simulation Data Inspector repository, returned as a positive integer.

Signal IDs for signals in copied run, returned as a vector of positive integers.

Version History

Introduced in R2011b