Documentation Center

  • Trial Software
  • Product Updates

Contents

Simulink.sdi.DiffSignalResult class

Package: Simulink.sdi

Results from comparing two signals

Description

The Simulink.sdi.DiffSignalResult object manages the results from comparing two signals. A Simulink.sdi.DiffSignalResult object contains the value differences of the signals, the tolerance data, and the data after any specified synchronization methods are performed.

Construction

The function Simulink.sdi.compareSignals returns a handle to a Simulink.sdi.DiffSignalResult object, which contains the comparison results.

A Simulink.sdi.DiffSignalResult object is also created when the function Simulink.sdi.compareRuns creates a Simulink.sdi.DiffRunResult object, which in turn creates Simulink.sdi.DiffSignalResult objects.

Properties

signalID1

Signal ID, a unique number identifying the first signal compared.

signalID2

Signal ID, a unique number identifying the second signal compared.

match

A boolean indicating if the two timeseries objects match according to the specified tolerance and time synchronization options.

diff

A MATLAB timeseries object specifying the value differences after synchronizing the two time series data.

tol

A MATLAB timeseries object specifying the actual absolute tolerance value at each synchronized time point.

sync1

A MATLAB timeseries object specifying time series 1 after synchronization has been applied.

sync2

A MATLAB timeseries object specifying time series 2 after synchronization has been applied.

Copy Semantics

Handle. To learn how handle classes affect copy operations, see Copying Objects in the MATLAB® documentation.

Examples

In this example, a Simulink.sdi.DiffSignalResult object is created after comparing two signals in the Simulation Data Inspector.

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

% Create a Simulation Data Inspector run and get signal IDs
[~, ~, signalIDs] = Simulink.sdi.createRun('My Run','namevalue',{'MyData'},{simOut});

sig1 = signalIDs(1);
sig2 = signalIDs(2);

% Compare two signals, which returns the results in an instance of Simulink.sdi.DiffSignalResult
diff = Simulink.sdi.compareSignals(sig1, sig2);

% Find if the signals match
match = diff.match;
 
% Get the tolerance used in Simulink.sdi.compareSignals
tolerance = diff.tol;

See Also

| |

How To

Was this topic helpful?