Main Content

sltest.testmanager.ParameterOverride class

Package: sltest.testmanager

Add or modify parameter override

Description

Instances of sltest.testmanager.ParameterOverride are parameters overrides contained in a parameter set within a test case that can override model parameters.

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

Class Attributes

HandleCompatible
true

For information on class attributes, see Class Attributes.

Creation

obj = sltest.testmanager.ParameterSet.addParameterOverride creates a sltest.testmanager.ParameterOverride object for a parameter set object.

Properties

expand all

Name of the parameter override, specified as a character vector.

Attributes:

SetAccess
public
GetAccess
public
Dependent
true
NonCopyable
true

Value of the parameter override, specified as a scalar or vector value. If the value is a string, it is evaluated as a MATLAB® expression when the test executes.

Attributes:

SetAccess
public
GetAccess
public
Dependent
true
NonCopyable
true

Indicates if the parameter override is enabled, 0 if it is not enabled, or 1 if it is enabled.

Attributes:

SetAccess
public
GetAccess
public
Dependent
true
NonCopyable
true

Source of the parameter override, returned as a character vector. Two examples of sources are the base workspace and a Model block. The parameter is read-only.

Attributes:

SetAccess
private
GetAccess
public
Dependent
true
NonCopyable
true

Workspace of the parameter to override, specified as a string or character vector.

Attributes:

SetAccess
private
GetAccess
public
Dependent
true
NonCopyable
true

Methods

expand all

Examples

collapse all

% Open the model for this example
openExample('sldemo_absbrake');

% 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');

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

% Test a new model parameter by overriding it in the test case
% parameter set
ps = addParameterSet(tc,'Name','API Parameter Set');
po = addParameterOverride(ps,'m',55);
Introduced in R2015b