Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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

expand all

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

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

Example:

The maximum numerical difference between the two signals, stored as a double.

Example:

Signal ID, a unique number identifying the first signal compared, stored as an integer.

Signal ID, a unique number identifying the second signal compared, stored as an integer.

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

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

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

Examples

expand all

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;
Was this topic helpful?