Main Content

compare

Compare signal data

Syntax

[matchNames, matchFigures, mismatchNames, mismatchFigures] = cgv.CGV.compare(data_set1, data_set2)
[matchNames, matchFigures, mismatchNames, mismatchFigures] = cgv.CGV.compare(data_set1, data_set2, 'Plot', param_value)
[matchNames, matchFigures, mismatchNames, mismatchFigures] = cgv.CGV.compare(data_set1, data_set2, 'Plot', 'none', 'Signals', signal_list, 'ToleranceFile', file_name)

Description

[matchNames, matchFigures, mismatchNames, mismatchFigures] = cgv.CGV.compare(data_set1, data_set2) compares data from two data sets which have common signal names between both executions. Possible outputs of the cgv.CGV.compare function are matched signal names, figure handles to the matched signal names, mismatched signal names, and figure handles to the mismatched signal names. By default, cgv.CGV.compare looks at the signals which have a common name between both executions.

[matchNames, matchFigures, mismatchNames, mismatchFigures] = cgv.CGV.compare(data_set1, data_set2, 'Plot', param_value) compares the signals and plots the signals according to param_value.

[matchNames, matchFigures, mismatchNames, mismatchFigures] = cgv.CGV.compare(data_set1, data_set2, 'Plot', 'none', 'Signals', signal_list, 'ToleranceFile', file_name) compares only the given signals and does not produce plots.

Input Arguments

data_set1, data_set2

Output data from a model. After running the model, use the getOutputData function to get the data. The cgv.CGV.getOutputData function returns a cell array of the output signal names.

varargin

Variable number of parameter name and value pairs.

varargin Parameters

You can specify the following argument properties for the cgv.CGV.compare function using parameter name and value argument pairs. These parameters are optional.

Plot(optional)

Designates which comparison data to plot. The value of this parameter must be one of the following:

  • 'match': plot the comparison of the matched signals from the two data sets

  • 'mismatch'(default): plot the comparison of the mismatched signals from the two datasets

  • 'none': do not produce a plot

Signals(optional)

A cell array of character vectors, where each vector is a signal name in the output data. Use getSavedSignals to view the list of available signal names in the output data. signal_list can contain an individual signal or multiple signals. The syntax for an individual signal name is:

signal_list = {'log_data.subsystem_name.Data(:,1)'}
The syntax for multiple signal names is:
signal_list = {'log_data.block_name.Data(:,1)',...
									 'log_data.block_name.Data(:,2)',...
                      'log_data.block_name.Data(:,3)',...
                      'log_data.block_name.Data(:,4)'};
If a model component contains a space or newline character, MATLAB® adds parentheses and a single quote to the name of the component. For example, if a section of the signal has a space, 'block name', MATLAB displays the signal name as:
log_data.('block name').Data(:,1)
To use the signal name as input to a CGV function, 'block name' must have two single quotes. For example:
signal_list = {'log_data.(''block name'').Data(:,1)'}

If Signals is not present, the signals are compared.

Tolerancefile(optional)

Name for the file created by the createToleranceFile function. The file contains the signal names and the associated tolerance parameter name and value pair for comparing the data.

Output Arguments

Depending on the data and the parameters, the following output arguments might be empty.

match_names

Cell array of matching signal names.

match_figures

Array of figure handles for matching signals

mismatch_names

Cell array of mismatching signal names

mismatch_figures

Array of figure handles for mismatching signals