Skip to Main Content Skip to Search
Product Documentation

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 "sldemo_f14" for logging and simulate
simOut = sim('sldemo_f14','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)

See Also

Simulink.sdi.createRun | Simulink.sdi.getRunCount | Simulink.sdi.isValidRunID

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS