Contents

Simulink.sdi.getSignal

Return Simulink.sdi.Signal object for signal in Simulation Data Inspector

Syntax

signal = Simulink.sdi.getSignal(signalID)

Description

signal = Simulink.sdi.getSignal(signalID) returns the Simulink.sdi.Signal object for the signal corresponding to the signal ID. The Simulink.sdi.Signal object manages the signal's time series data and metadata.

Input Arguments

signalID

Signal ID, a unique number identifying a signal in the Simulation Data Inspector.

Output Arguments

signal

A handle to the Simulink.sdi.Signal object.

Examples

Get the Simulink.sdi.Signal object for a signal in the Simulation Data Inspector. With the signal object you can modify its comparison and visualization properties.

% Configure model "slexAircraftExample" for logging and simulate
simOut = sim('slexAircraftExample','SaveOutput','on','SaveFormat','StructureWithTime');

% Create a Simulation Data Inspector run
[runID, runIndex, signalIDs] = Simulink.sdi.createRun('My Run','base',{'simOut'})

signalObj = Simulink.sdi.getSignal(signalIDs(1));

% Specify the comparison and visualization signal properties
signalObj.absTol = .5;
signalObj.syncMethod = 'intersection';
signalObj.interpMethod = 'linear';
signalObj.lineColor = [1,0.4,0.6];
signalObj.lineDashed = '-';
signalObj.checked = true;

% view the signals in Simulation Data Inspector GUI
Simulink.sdi.view
Was this topic helpful?