find
Class: slreq.LinkSet
Namespace: slreq
Find links in link set with matching attribute values
Syntax
myLinks = find(myLinkSet,"PropertyName1",PropertyValue1,...,"PropertyNameN",PropertyValueN)
Description
returns links in the link set myLinks
= find(myLinkSet
,"PropertyName1"
,PropertyValue1
,...,"PropertyNameN"
,PropertyValueN
)myLinkSet
that match the properties
specified by PropertyName
and PropertyValue
.
Input Arguments
myLinkSet
— Link set
slreq.LinkSet
object
Link set, specified as an slreq.LinkSet
object.
PropertyName
— Link property
string scalar | character vector
Link property name, specified as a string scalar or a character vector that contains
the name of an slreq.Link
property name or a link destination attribute. For a list of valid
property names, see the valid property names in the Properties section of slreq.Link
.
The valid link destination attributes are:
"destination.domain"
"desintation.artifact"
"destination.id"
"destination.summary"
The link destination attributes correspond to the structure fields of the
output of the destination
method.
Example: 'Type','Keywords','SID'
PropertyValue
— Link property value
character vector | character array | datetime
value | scalar | logical
| structure array
Link property value, specified as a character vector, character array,
datetime
value, scalar, logical
, or structure
array. The data type depends on the specified PropertyName
. See the
valid property values in the Properties section of slreq.Link
.
Example: 'Type','Keywords','SID'
Output Arguments
myLinks
— Links
slreq.Link
array
Links, returned as an slreq.Link
array.
Examples
Find a Link in a Link Set
This example shows how to find a link in a link set that matches the specified property value.
Load the myAddRequirements
requirement set, which also loads the myAdd
link set. Then, find the myAdd
link set.
slreq.load("myAddRequirements"); ls = slreq.find("Type","LinkSet","Name","myAdd");
Find a link that matches the specified SID.
myLink = find(ls,"SID","3");
Find all links that have the specified revision.
myLinks = find(ls,"Revision","4")
myLinks=1×3 Link array with properties:
Type
Description
Keywords
Rationale
CreatedOn
CreatedBy
ModifiedOn
ModifiedBy
Revision
SID
Comments
Find a link that matches the specified SID and revision.
myLink2 = find(ls,"SID","3","Revision","4");
Find Links by Destination Attributes
This example shows how to find links that match the specified destination attribute.
Load the myAddRequirements
requirement set, which also loads the myAdd
link set. Then, find the myAdd
link set.
slreq.load("myAddRequirements"); myLinkSet = slreq.find("Type","LinkSet","Name","myAdd");
Use the slreq.find
function to find the links whose destination artifact is myAddRequirements.slreqx
.
fp = which("myAddRequirements.slreqx"); myLinks = slreq.find("Type","Link","destination.artifact",fp);
Use the find
method to find the links in the link set whose summary is Input u
.
myLinks = find(myLinkSet,"destination.summary","Input u");
Version History
Introduced in R2018aR2024a: Find links by destination attributes
Find links by destination attributes by specifying PropertyName
as
a link destination attribute, specified as one of these strings:
"destination.domain"
"desintation.artifact"
"destination.id"
"destination.summary"
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)