Main Content

createToleranceFile

Create file correlating tolerance information with signal names

Syntax

cgvObj.createToleranceFile(file_name , signal_list, tolerance_list)

Description

cgvObj.createToleranceFile(file_name , signal_list, tolerance_list) creates a MATLAB® file, named file_name, containing the tolerance specification for each output signal name in signal_list. Each signal name in the signal_list corresponds to the same location of a parameter name and value pair in the tolerance_list.

Input Arguments

file_name

Name for the file containing the tolerance specification for each signal. Use this file as input to cgv.CGV.compare and cgv.Batch.addTest.

signal_list

A cell array of character vectors, where each vector is a signal name for data from the model. 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)'};

To specify a global tolerance for the signals, include the reserved signal name, 'global_tolerance', in signal_list. Assign a global tolerance value in the associated tolerance_list. If signal_list contains other signals, their associated tolerance value overrides the global tolerance value. In this example, the global tolerance is a relative tolerance of 0.02.

signal_list = {'global_tolerance',...
'log_data.block_name.Data(:,1)',...
'log_data.block_name.Data(:,2)'};

tolerance_list = {{'relative', 0.02},...
	{'relative', 0.015},{'absolute', 0.05}};

Note

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 the signal name 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 in the signal_list. For example:
signal_list = {'log_data.(''block name'').Data(:,1)'}

tolerance_list

Cell array of cell arrays. Each element of the outer cell array is a cell array containing a parameter name and value pair for the type of tolerance and its value. Possible parameter names are 'absolute' | 'relative' | 'function'. There is a one-to-one mapping between each parameter name and value pair in the tolerance_list and a signal name in the signal_list. For example, a tolerance_list for a signal_list containing four signals might look like the following:

tolerance_list = {{'relative', 0.02},{'absolute', 0.06},...
	{'relative', 0.015},{'absolute', 0.05}};