Documentation

sltest.testmanager.BaselineCriteria class

Package: sltest.testmanager
Superclasses:

Add or modify baseline criteria

Description

An instance of sltest.testmanager.BaselineCriteria is a set of signals in a test case that determines the pass-fail criteria in a baseline test case.

Construction

obj = sltest.testmanager.TestCase.addBaselineCriteria creates a sltest.testmanager.BaselineCriteria object for a test case object.

Properties

expand all

Absolute tolerance for the baseline criteria set, specified as a scalar.

Indicates if the baseline criteria is enabled, 0 if it is not enabled, and 1 if it is enabled.

This property is read-only.

Sheet and range information for Microsoft® Excel® baseline file, returned as a 1-by-N array, where each row has a Sheet and Range value. Specify Range as shown in the table.

Ways to specify Range Description

'Corner1:Corner2'

Rectangular Range

Specify the range using the syntax 'Corner1:Corner2', where Corner1 and Corner2 are two opposing corners that define the region. For example, 'D2:H4' represents the 3-by-5 rectangular region between the two corners D2 and H4 on the worksheet. The 'Range' name-value pair argument is not case-sensitive, and uses Excel A1 reference style (see Excel help).

Example: 'Range','Corner1:Corner2'

''

Unspecified or Empty

If unspecified, the importing function automatically detects the used range.

Example: 'Range',''

Note: Used Range refers to the rectangular portion of the spreadsheet that actually contains data. The importing function automatically detects the used range by trimming any leading and trailing rows and columns that do not contain data. Text that is only white space is considered data and is captured within the used range.

'Row1:Row2'

Row Range

You can identify the range by specifying the beginning and ending rows using Excel row designators. Then readtable automatically detects the used column range within the designated rows. For instance, the importing function interprets the range specification '1:7' as an instruction to read all columns in the used range in rows 1 through 7 (inclusive).

Example: 'Range','1:7'

'Column1:Column2'

Column Range

You can identify the range by specifying the beginning and ending columns using Excel column designators. Then readtable automatically detects the used row range within the designated columns. For instance, the importing function interprets the range specification 'A:F' as an instruction to read all rows in the used range in columns A through F (inclusive).

Example: 'Range','A:F'

'NamedRange'

Excel’s Named Range

In Excel, you can create names to identify ranges in the spreadsheet. For instance, you can select a rectangular portion of the spreadsheet and call it 'myTable'. If such named ranges exist in a spreadsheet, then the importing function can read that range using its name.

Example: 'Range','myTable'

This property is read-only.

File path of the baseline criteria set, returned as a character vector.

Lagging time tolerance for the baseline criteria set, specified as a scalar.

Leading time tolerance for the baseline criteria set, specified as a scalar.

This property is read-only.

Name of the baseline criteria, returned as a character vector.

Relative tolerance for the baseline criteria set, specified as a scalar.

Methods

addExcelSpecificationAdd a Microsoft Excel sheet to baseline criteria or test case inputs
getSignalCriteriaGet signal criteria
removeRemove baseline criteria

Examples

expand all

This example captures a baseline for a test and changes the absolute tolerance from 0 to 9.

% Create the test file, test suite, and test case structure
tf = sltest.testmanager.TestFile('API Test File');
ts = createTestSuite(tf,'API Test Suite');
tc = createTestCase(ts,'baseline','Baseline API Test Case');

% Remove the default test suite
tsDel = getTestSuiteByName(tf,'New Test Suite 1');
remove(tsDel);

% Assign the system under test to the test case
setProperty(tc,'Model','sldemo_absbrake');

% Capture the baseline criteria
baseline = captureBaselineCriteria(tc,'baseline_API.mat',true);

% Set the baseline criteria tolerance for a signal
sc = getSignalCriteria(baseline);
sc(1).AbsTol = 9;

Introduced in R2015b

Was this topic helpful?