Contents

How the Simulation Data Inspector Compares Time Series Data

To compare time series data, the Simulation Data Inspector:

  1. Converts Simulink® time series data to MATLAB® time series data.

  2. Aligns the time vectors using the default synchronization method union. (You can change the synchronization method for a signal: add the Sync Method column to the Navigation pane table and choose a method.)

  3. Aligns the data vectors using the default interpolation method, zoh (zero-order hold). (You can change the interpolation method for a signal: add the Interpolation Method column to the Navigation pane table and choose a method.)

  4. Differences the data.

  5. Applies the specified tolerances for plotting the difference. For more information, see How the Simulation Data Inspector Applies Tolerances.

After it aligns signals from Baseline with signals from Compare To, the Simulation Data Inspector compares only the aligned signals. The Comparisons pane displays the results of all signal comparisons using these symbols.

StatusComparison Result
  • Signal aligns.

  • Signal data from two runs matches within the tolerance.

  • Signal aligns.

  • Signal data from two runs does not match within the tolerance.

Signal from Baseline does not align with a signal from Compare To.

How the Simulation Data Inspector Applies Tolerances

The default value for the relative tolerance and absolute tolerance for a signal is zero. If you specify tolerances, then the Simulation Data Inspector calculates the tolerances as follows:

tolerance = max(absoluteTolerance,relativeTolerance*abs(baselineData));

If you want to change the relative tolerance or absolute tolerance, select the Rel Tol or Abs Tol columns in the Comparisons pane and type a value.

How the Simulation Data Inspector Aligns Signals

When the Simulation Data Inspector aligns signals across simulation runs, it attempts to match signals between runs using signal properties. On the Compare tab, click Comparison Options. In the dialog box, you can specify the signal properties to use to align signals, as shown in the table.

PropertyDescription
Data SourcePath of the variable in the MATLAB workspace (streamed signals do not have a data source because they do not come from the workspace)
PathBlock path of the source signal that produced the data
SIDSimulink Identifier, which is consistent even when the block is renamed or moved
Signal NameName of the signal in the model

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.

An instance where a comparison of signals does not align is if a signal name is different between two runs and the Comparison Options alignment properties are set to align by signal name only. In this case, the signal comparison does not align.

Related Examples

Was this topic helpful?