sltest.testmanager.ParameterSet Class
Namespace: sltest.testmanager
Add or modify parameter set
Description
Instances of sltest.testmanager.ParameterSet
are sets of parameters
in a test case that can override model parameters.
The sltest.testmanager.ParameterSet
class is a handle
class.
Creation
creates a obj
= sltest.testmanager.TestCase.addParameterSetsltest.testmanager.ParameterSet
object for a test case
object.
Properties
Name
— Parameter set name
string
Name of the parameter set, specified as a string. If the parameter set was created from a MAT file, the name is derived from the MAT filename and is read-only.
Attributes:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
FilePath
— File path
character vector
File path of the parameter set if parameters were added from a file, returned as a character vector.
Attributes:
SetAccess | private |
GetAccess | public |
Dependent | true |
NonCopyable | true |
Active
— Active overrides indicator
0
| 1
Indicates whether to use the overrides in the parameter set during test
execution. If Active
is 0
, the
overrides are not used. If Active
is
1
, the overrides are used.
Attributes:
SetAccess | public |
GetAccess | public |
Dependent | true |
NonCopyable | true |
ExcelSpecifications
— Sheet and range information for Excel file
1-by-N array
Sheet and range information for Microsoft®
Excel® 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 |
---|---|
Rectangular Range | Specify the range using the syntax
Example:
|
Unspecified or Empty | If unspecified, the importing function automatically detects the used range. Example:
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. |
Row Range | You can identify the range by specifying the
beginning and ending rows using Excel row designators. Then
Example:
|
Column Range | You can identify the range by specifying the
beginning and ending columns using Excel column designators. Then
Example:
|
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 Example:
|
Attributes:
GetAccess | public |
SetAccess | public |
Dependent | true |
NonCopyable | true |
Data Types: array
Methods
Public Methods
addParameterOverride | Add parameter override to parameter set |
export | Export parameter set to Excel spreadsheet |
getParameterOverrides | Get parameter overrides |
remove | Remove parameter set |
Examples
Add Parameter Override to Test Case
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);
Clear the Test Manager.
sltest.testmanager.clear sltest.testmanager.clearResults sltest.testmanager.close
Version History
Introduced in R2015b
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
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)