Main Content

sltest.testmanager.BaselineCriteria Class

Namespace: sltest.testmanager

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.

The sltest.testmanager.BaselineCriteria class is a handle class.

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

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

Properties

expand all

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

Attributes:

GetAccess
public
SetAccess
private
Dependent
true
NonCopyable
true

Data Types: character vector

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

Attributes:

GetAccess
public
SetAccess
public
Dependent
true
NonCopyable
true

Data Types: scalar

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

Attributes:

GetAccess
public
SetAccess
public
Dependent
true
NonCopyable
true

Data Types: logical

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

Attributes:

GetAccess
public
SetAccess
private
Dependent
true
NonCopyable
true

Data Types: character vector

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

Attributes:

GetAccess
public
SetAccess
public
Dependent
true
NonCopyable
true

Data Types:

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

Attributes:

GetAccess
public
SetAccess
public
Dependent
true
NonCopyable
true

Data Types:

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

Attributes:

GetAccess
public
SetAccess
public
Dependent
true
NonCopyable
true

Data Types:

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 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 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'

Attributes:

GetAccess
public
SetAccess
public
Dependent
true
NonCopyable
true

Data Types: array

Methods

expand all

Examples

collapse all

This example shows how to add the baseline criteria class for a test and change the absolute tolerance from 0 to 9.

Open the model for this example.

sldemo_absbrake

Create the test file, test suite, and test case structure.

tf = sltest.testmanager.TestFile('API_Test_File.mldatx');
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;

Clear the Test Manager.

sltest.testmanager.clear
sltest.testmanager.clearResults
sltest.testmanager.close

Version History

Introduced in R2015b