addParameterSet
Class: sltest.testmanager.TestCase
Namespace: sltest.testmanager
Add parameter set
Syntax
pset = addParameterSet(tc,Name,Value)
Description
adds
a parameter set to the test case and returns a parameter set object, pset
= addParameterSet(tc
,Name,Value
)sltest.testmanager.ParameterSet
.
Input Arguments
tc
— Test case
sltest.testmanager.TestCase
object
Test case that you want to add the parameter set to, specified
as a sltest.testmanager.TestCase
object.
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.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
Example: 'SimulationIndex',2
Name
— Parameter set name
auto-generated unique
name (default) | character vector
Name of the parameter set, specified as a character vector. This name is the label shown in the test case parameter set table. If you do not specify a name, the function creates an auto-generated unique name.
FilePath
— Parameter set name and file path
character vector
The full name and path of the .m file or MAT-file, which contains the parameter values, specified as a character vector. If no parameter file path is given, then the function creates an empty parameter set.
SimulationIndex
— Simulation number
1
(default) | 2
Simulation number to which the parameter set applies, specified as an integer,
1
or 2
. This
parameter applies to the simulation test case
where there are two simulations. For baseline and
simulation test cases, the simulation index is
1
.
Sheets
— Excel® spreadsheet sheet names
string array
Excel spreadsheet names for which you want
to create parameter sets, specified as a string
array. If you do specify
Sheets
, a parameter set is
created for each
sheet in the file.
Output Arguments
pset
— Parameter set
sltest.testmanager.ParameterSet
object
Parameter set, returned as an sltest.testmanager.ParameterSet
object.
Examples
Add Parameter Set to Test Case
% 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'); % 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'); % Test a new model parameter by overriding it in the test case % parameter set ps = addParameterSet(tc,'Name','API Parameter Set');
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 (한국어)