Documentation Center

  • Trial Software
  • Product Updates


Simulink.sdi.DiffSignalResult class

Package: Simulink.sdi

Results from comparing two signals


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.


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.



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


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


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


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


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


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


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.


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', ...

% 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?