Documentation

Simulink.sdi.isValidRunID

Determine if run ID is valid

Syntax

  • isValid = Simulink.sdi.isValidRunID(runID)
    example

Description

example

isValid = Simulink.sdi.isValidRunID(runID) returns true if the runID corresponds to a run currently in the Simulation Data Inspector. Otherwise, it returns false.

Examples

collapse all

Verify Run IDs

Before comparing the simulation data of two runs, you can verify that the run IDs are valid.

% Configure model "slexAircraftExample" for logging and simulate
simOut = sim('slexAircraftExample','SaveOutput','on', ...
             'SaveFormat','StructureWithTime', ...
             'ReturnWorkspaceOutputs','on');
 
% Create a Data Inspector run
run1ID = Simulink.sdi.createRun('First Run','base',{'simOut'});
run2ID = Simulink.sdi.createRun('Second Run','base',{'simOut'});

% Check if run IDs are valid in Simulation Data Inspector
run1ID_valid = Simulink.sdi.isValidRunID(run1ID);
run2ID_valid = Simulink.sdi.isValidRunID(run2ID);

if run1ID_valid & run2ID_valid
% Compare two runs
   difference = Simulink.sdi.compareRuns(run1ID,run2ID);
end

Related Examples

Input Arguments

collapse all

runID — Unique run identifierinteger

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

Output Arguments

collapse all

isValid — Valid run indicatorlogical

Indication of whether the run is a valid Simulation Data Inspector run, returned as a Boolean value: 1, if the run exists; 0, otherwise.

Introduced in R2011b

Was this topic helpful?