You can tailor the Simulation Data Inspector comparison process to fit your requirements in multiple ways. When comparing runs, the Simulation Data Inspector:
Aligns signal pairs in the Baseline and Compare To runs based on the Alignment settings.
The Simulation Data Inspector does not compare signals that it cannot align.
Synchronizes aligned signal pairs according to the specified Sync Method.
Interpolates data in signal pairs as specified by the Interpolation Method.
Computes the difference of the signal pairs.
Compares the difference result against specified tolerances.
When the comparison run completes, the results of the comparison are added in the navigation pane.
|Signal from Baseline does not align with a signal from Compare To.|
When you compare signals of different lengths, the Simulation Data Inspector compares the signals on their overlapping interval.
The first step in a comparison is to align the signals, or, decide which signals in the Baseline and Compare To runs the Simulation Data Inspector should compare to each other. When you compare signals with the Simulation Data Inspector, you complete the alignment step by selecting the Baseline and Compare To signals.
The Simulation Data Inspector aligns signals using signal properties. In the Alignment tab of the Preferences window, you can specify the priority order for each of the signal properties used for alignment. The Align By field specifies the highest priority property. The priority drops with each subsequent Then By field. You must specify a primary alignment property in the Align By field, but you can leave any number of the Then By fields blank.
From each drop-down, you can select
Signal Name. By default, the Simulation Data
Inspector is configured to first align signals by data source, then
by path, then by SID, and then by signal name. For more information
on how to change alignment settings, see Modify Signal Alignment for Comparisons.
|Data Source||Path of the variable in the MATLAB® workspace for data imported from the workspace|
|Path||Block path for the source of the data in the model|
Numeric signal identifier
For more information about SIDs, see Locate Diagram Components Using Simulink Identifiers
|Signal Name||Name of the signal in the model|
You can choose how the Simulation Data Inspector synchronizes
signals when their time vectors do not contain all the same sample
times. You can select
the synchronization method.
When you specify
union synchronization, the
Simulation Data Inspector builds a time vector that comprises every
sample time represented between the two signals. For each sample time
not originally present in either signal, the Simulation Data Inspector
interpolates the value. When you specify
the Simulation Data Inspector uses only the sample times present in
both signals in the comparison.
Choosing between the two options is a trade off between speed
and accuracy. The interpolation required by
takes time, but provides a more precise result. When you use
the run completes quickly because the Simulation Data Inspector computes
fewer data points and does not interpolate. However, some data is
discarded in the process.
You can choose to interpolate your data with a zero-order hold
(zoh) or a linear approximation. When you specify
the Interpolation Method, the Simulation Data
Inspector replicates the data of the previous sample for interpolated
sample times. When you specify
the Simulation Data Inspector uses sample times on either side of
the interpolated time to linearly approximate the value of the interpolated
You can specify absolute, relative, and time tolerances in the
Simulation Data Inspector. You can specify all tolerances globally,
at the top of the graphical viewing area, or on a signal by signal
basis in the properties pane. To use a signal tolerance, change Override
Global Tol to
When you specify multiple tolerance, sometimes each tolerance yields a different answer for what the tolerance should be at each point. The Simulation Data Inspector computes the overall tolerance band by selecting the most lenient tolerance result for each data point.
First, the Simulation Data Inspector computes the tolerance band using only the absolute and magnitude tolerances:
tolerance = max(absoluteTolerance,relativeTolerance*abs(baselineData));
The upper boundary of the tolerance band is formed by adding
the Baseline signal. Similarly, the lower boundary
of the tolerance band is formed by subtracting
the Baseline signal.
To apply the time tolerance, the Simulation Data Inspector looks
at a time interval defined as
For the upper boundary of the tolerance band, the Simulation Data
Inspector selects the maximum value on the interval for each data
point. For the lower boundary of the tolerance band, the Simulation
Data Inspector selects the minimum value on the interval for each