Class: Simulink.sdi.Run
Package: Simulink.sdi

Return Simulink.sdi.Signal object by signal ID


signalObj = runObj.getSignal(signalID)


signalObj = runObj.getSignal(signalID) returns the Simulink.sdi.Signal object, signalObj, corresponding to the signal ID, signalID, stored in the Simulink.sdi.Run object, runObj.

Input Arguments

expand all

Unique number identifying a signal in a run, specified as an integer.

Output Arguments

expand all

A signal within a run object, Simulink.sdi.Run, returned as a Simulink.sdi.Signal object.


expand all

The Simulink.sdi.Run method, getSignal, returns a signal object representing the signal data and metadata in a run. You can modify the signal object properties to configure the signal for plotting or comparing to other signals in the Simulation Data Inspector.

% Configure model "slexAircraftExample" for logging and simulate
simOut = sim('slexAircraftExample','SaveOutput','on',...
% Create a Simulation Data Inspector run
[runID,runIndex,signalIDs] = Simulink.sdi.createRun('My Run','base',{'simOut'});
% Get the Simulink.sdi.Run object corresponding to the new run ID
runObj = Simulink.sdi.getRun(runID);
% Get the number of signals in the run
numSignals = runObj.signalCount;
% Get the Simulink.sdi.Signal objects for each signal
% in the run and select for plotting 
for i = 1:numSignals
   signalObjs(i) = runObj.getSignal(signalIDs(i));
   signalObjs(i).checked = true;

Related Examples

Introduced in R2012b

Was this topic helpful?