sltest.harness.find
Find test harnesses in model
Syntax
Description
returns a structure listing harnesses and harness properties that exist for the
component or model harnessList
= sltest.harness.find(harnessOwner
)harnessOwner
.
uses additional search options specified by one or more
harnessList
= sltest.harness.find(harnessOwner
,Name,Value
)Name
,Value
pair arguments.
Examples
Use RegExp to Find Harnesses for a Model Component
Find harnesses for the f14
model and its
first-level subsystems. The function matches harness names according to a
regular expression.
openExample('f14'); sltest.harness.create('f14','Name','model_harness'); sltest.harness.create('f14/Controller','Name',... 'Controller_Harness1'); harnessList = sltest.harness.find('f14',... 'SearchDepth',1,'Name','_[Hh]arnes+',... 'RegExp','on')
harnessList = 1x2 struct array with fields: model name description type ownerHandle ownerFullPath ownerType isOpen canBeOpened verificationMode saveExternally rebuildOnOpen rebuildModelData graphical origSrc origSink
Input Arguments
harnessOwner
— Model or component
character vector | double
Model or component handle or path, specified as a character vector or double
Example: 1.9500e+03
Example: 'model_name'
Example: 'model_name/Subsystem'
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: 'SearchDepth',2,'Name','controller_harness'
searches
the model or component, and two lower hierarchy levels, for harnesses named
controller_harness
.
Name
— Harness name to search for
character vector | regular expression
Harness name to search for in the model, specified as the
comma-separated pair consisting of 'Name'
and a
character vector or a regular expression. You can specify a regular
expression only if you also use the
Name
,Value
pair
'RegExp'
,'on'
.
Example: 'Name','sample_harness'
'Name','_[Hh]arnes+'
RegExp
— Ability to search using a regular expression
'off'
(default) | 'on'
Ability to search using a regular expression, specified as the
comma-separated pair consisting of 'RegExp'
and
'off'
or 'on'
. When
'RegExp'
is set to 'on'
, you
can use a regular expression with 'Name'
.
Example: 'RegExp','on'
SearchDepth
— Subsystem levels to search
all levels (default) | nonnegative integer
Subsystem levels into harnessOwner
to search for
harnesses, specified as the comma-separated pair consisting of
'SearchDepth'
and an integer. For example:
0
searches harnessOwner
.
1
searches harnessOwner
and its
subsystems.
2
searches harnessOwner
, its
subsystems, and their subsystems.
When you do not specify SearchDepth
, the function
searches all levels of
harnessOwner
.
Example: 'SearchDepth',1
OpenOnly
— Search option for open harnesses
'off'
(default) | 'on'
Search option to return only open or loaded harnesses, specified as
the comma-separated pair consisting of 'OpenOnly'
and
'off'
or 'on'
.
Example: 'OpenOnly','on'
FunctionInterfaceName
— Name of the function interface to search for
string | character vector
Name of the function interface for the reusable library subsystem to search for, specified as a string or character vector. Using this Name-Value pair returns a list of all harnesses for the specified function interface.
Example: 'FunctionInterfaceName','double_RLS'
Output Arguments
harnessList
— List of harnesses and properties
structure
List of harnesses and properties for the component or model
harnessOwner
, returned as a structure. The
structure fields are shown in the Use RegExp to Find Harnesses for a Model Component example.
Version History
Introduced in R2015a
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)