Simulink.sdi.Run class

Package: Simulink.sdi

Manages signal data and metadata of simulation run


The Simulink.sdi.Run object contains the signal information for one simulation run, which includes the signal data, a run ID, and the total number of signals in the run.


The function Simulink.sdi.createRun creates a Simulink.sdi.Run object.


expand all

dateCreatedRun creation dateobject

Date and time of the run, stored as a datetime object.

descriptionRun descriptionempty string (default)

Description of the run, specified as a string. The default value is an empty string.

idRun identifierinteger

Unique number to identifying a run, stored as an integer.

nameRun nameempty string (default)

Name of the run, specified as a string. The default value is an empty string.

signalCountNumber of signals in runinteger

Number of signals in the run, stored as an integer.

tagInformation tagempty string (default)

Tag for categorization, identification, or attaching other information to this run, specified as a string. The default value is an empty string.


getSignalReturn Simulink.sdi.Signal object by signal ID
getSignalByIndexReturnSimulink.sdi.Signal object by index
getSignalIDByIndexReturn signal ID at array index
isValidSignalIDDetermine if signal ID is valid within run


expand all

Create Run From Workspace Data

The Simulink.sdi.Run object contains a Simulink.sdi.Signal object for each logged signal. This example creates a run from simulation data in the base workspace. It demonstrates how to access the Simulink.sdi.Run object from the Simulation Data Inspector . You can select which signals to view and then open the Simulation Data Inspector tool to inspect those signals.

% Configure model "slexAircraftExample" for logging and simulate
simOut = sim('slexAircraftExample','SaveOutput','on',...

% Create a Simulation Data Inspector run, Simulink.sdi.Run,
% from simOut in the base workspace
runID = Simulink.sdi.createRun('My Run','base',{'simOut'});

% Get the handle to the run object, Simulink.sdi.Run,
% corresponding to the new run ID
runObj = Simulink.sdi.getRun(runID);

% Get the name of the run
runName =;

% Get number of signals
numSignals = runObj.signalCount;

% To view the all of the signals in the run, select each signal
% in the run by setting the checked property to 'true'
for i=1:numSignals
		signalObj = runObj.getSignalByIndex(i);
		signalObj.checked = true;

% Open the Simulation Data Inspector to inspect the selected signals.

Related Examples

Introduced in R2012b

Was this topic helpful?