addParameterOverride
Class: sltest.testmanager.ParameterSet
Namespace: sltest.testmanager
Add parameter override to parameter set
Syntax
ovr = addParameterOverride(ps,ParamName,ParamValue)
ovr = addParameterOverride(___,Name,Value)
Description
adds a parameter override to a parameter set and returns a parameter override object,
ovr
= addParameterOverride(ps
,ParamName
,ParamValue
)sltest.testmanager.ParameterOverride
.
specifies options using one or more name-value arguments in addition to the input
arguments in previous syntax.ovr
= addParameterOverride(___,Name,Value
)
Input Arguments
ps
— Parameter set
sltest.testmanager.ParameterSet
object
Parameter set to which you want to add the override, specified as a sltest.testmanager.ParameterSet
object.
ParamName
— Parameter name
string scalar | character vector
Name of the parameter to override, specified as a string or character
vector. If ParamName
is a block parameter, use the
programmatic name.
Data Types: char
| string
ParamValue
— Parameter value
any data type, depending on the
parameter
Parameter value to override, specified in the format determined by the
parameter type. If ParamValue
is a string scalar, it is
evaluated as a MATLAB® expression when the test executes.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: ovr =
addParameterOverride(ps,'a',2,BlockPath='myModel/Controller1')
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: ovr =
addParameterOverride(ps,'a',2,'BlockPath','myModel/Controller1')
BlockPath
— Block path
string | character vector
Block path of the parameter to override, specified as a string or
character vector. Specify BlockPath
only if the
parameter to override is a block or block mask parameter stored in a
mask workspace. The combination of ParamName
and
BlockPath
properties must be unique within a
parameter set.
Data Types: char
| string
Workspace
— Workspace that contains the parameter
string | character vector
Workspace that contains the parameter to override, specified as a
string or character vector. Specify Workspace
if you
are overriding a parameter in a model reference. Different model
references can have a model workspace parameter with the same name, so
Workspace
indicates which workspace parameter to
override.
Data Types: char
| string
Output Arguments
ovr
— Parameter override
sltest.testmanager.ParameterOverride
object
Parameter override added to the parameter set, returned as an sltest.testmanager.ParameterOverride
object.
Examples
Add Parameter Override to Parameter Set
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"); 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);
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);
Add Parameter Override to Override Block Parameter
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"); 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);
Test a new value of the Constant block labeled Desired relative slip
by overriding it in the test case parameter set.
ps = addParameterSet(tc,"Name","API Parameter Set"); po = addParameterOverride(ps,"Value",0.22,... "sldemo_absbrake/Desired relative slip");
Version History
Introduced in R2015b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)