Documentation

Simulink.sdi.Run class

Package: Simulink.sdi

Manages signal data and metadata of simulation run

Description

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.

Construction

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

Properties

expand all

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

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

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

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

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

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

Methods

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

Examples

expand all

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',...
                  'SaveFormat','StructureWithTime',...
                  'ReturnWorkspaceOutputs','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 = runObj.name;

% 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;
end

% Open the Simulation Data Inspector to inspect the selected signals.
Simulink.sdi.view;

Related Examples

Introduced in R2012b

Was this topic helpful?