Documentation

Simulink.sdi.getRunIDByIndex

Return the run ID corresponding to run index

Syntax

  • runID = Simulink.sdi.getRunIDByIndex(runIndex)
    example

Description

example

runID = Simulink.sdi.getRunIDByIndex(runIndex) returns the run ID for the run corresponding to the run index.

Examples

collapse all

Get Run IDs For All Runs in the Simulation Data Inspector

% Configure model "slexAircraftExample" for logging and simulate
simOut = sim('slexAircraftExample','SaveOutput','on', ...
             'SaveFormat','StructureWithTime', ...
             'ReturnWorkspaceOutputs','on');

% Create a Simulation Data Inspector run
[runID, runIndex, signalIDs] = Simulink.sdi.createRun('Run1','base',{'simOut'});

% Get the ID of the previously created run by index 
runID2 = Simulink.sdi.getRunIDByIndex(runIndex);
 
% Both runID and runID2 reference the same run and should be equal
isequal(runID, runID2)
ans =

     1

Related Examples

Input Arguments

collapse all

runIndex — Simulation run indexinteger

Number representing an index to the list of runs currently in the Simulation Data Inspector, specified as an integer. The run index is an output of the Simulink.sdi.createRun function.

Output Arguments

collapse all

runID — Unique run identifierinteger

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

Introduced in R2011b

Was this topic helpful?