Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Simulink.sdi.isValidRunID

Determine if run ID is valid

Syntax

isValid = Simulink.sdi.isValidRunID(runID)

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

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

Input Arguments

collapse all

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

Output Arguments

collapse all

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?