Documentation

Contents

Simulink.sdi.getRunIDByIndex

Return the run ID corresponding to run index

Syntax

runID = Simulink.sdi.getRunIDByIndex(runIndex)

Description

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

Input Arguments

runIndex

Number representing an index to the list of runs currently in the Simulation Data Inspector.

Output Arguments

runID

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

Examples

Get the run IDs for all runs currently 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)
Was this topic helpful?