find
Class: slreq.LinkSet
Package: slreq
Find links in link set with matching attribute values
Syntax
myLinks = find(myLinkSet,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN)
Description
finds and returns myLinks
= find(myLinkSet
,'PropertyName1'
,PropertyValue1
,...,'PropertyNameN'
,PropertyValueN
)slreq.Link
objects in the link set
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
character vector
Link property name, specified as a character vector. See the valid property names in
the Properties section of slreq.Link
.
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
— Link
slreq.Link
object
Link or link array, specified as an slreq.Link
object.
Examples
Find a Link in a Requirement Set
This example shows how to find a link in a link set that matches the specified property value.
Open the Requirements Definition for a Cruise Control Model project. Load the crs_req
requirement set, which also loads the crs_req
link set. Then, find the crs_req
link set.
slreqCCProjectStart; slreq.load("crs_req"); ls = slreq.find("Type","LinkSet","Name","crs_req")
ls = LinkSet with properties: Description: '' Filename: '/tmp/Bdoc22a_1891349_99509/bml.batserve.147285/MATLAB/Projects/examples/CruiseRequirementsExample2/documents/crs_req.slmx' Artifact: '/tmp/Bdoc22a_1891349_99509/bml.batserve.147285/MATLAB/Projects/examples/CruiseRequirementsExample2/documents/crs_req.slreqx' Domain: 'linktype_rmi_slreq' Revision: 5 Dirty: 0 CustomAttributeNames: {}
Find a link that matches the specified SID.
myLink = find(ls,"SID","3")
myLink = Link with properties: Type: 'Derive' Description: '#8: Set Switch Detection' Keywords: {} Rationale: '' CreatedOn: 20-May-2017 13:14:40 CreatedBy: 'itoy' ModifiedOn: 02-Feb-2018 14:28:04 ModifiedBy: 'itoy' Revision: 4 SID: 3 Comments: [0x0 struct]
Find all links that are modified in the specified revision.
myLinks = find(ls,"Revision","4")
myLinks=1×12 object
1x12 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","8","Revision","4")
myLink2 = Link with properties: Type: 'Derive' Description: '#12: Increment Short Switch Detection' Keywords: {} Rationale: '' CreatedOn: 20-May-2017 13:15:45 CreatedBy: 'itoy' ModifiedOn: 02-Feb-2018 14:28:04 ModifiedBy: 'itoy' Revision: 4 SID: 8 Comments: [0x0 struct]
Cleanup
Clean up commands. Clear the open requirement sets and link sets. Close the current project.
slreq.clear; slproject.closeCurrentProject();
Version History
See Also
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
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)