Main Content

find

Class: slreq.LinkSet
Package: slreq

Find links in link set with matching attribute values

Syntax

myLinks = find(myLinkSet,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN)

Description

myLinks = find(myLinkSet,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN) finds and returns slreq.Link objects in the link set myLinkSet that match the properties specified by PropertyName and PropertyValue.

Input Arguments

expand all

Link set, specified as an slreq.LinkSet object.

Link property name, specified as a character vector. See the valid property names in the Properties section of slreq.Link.

Example: 'Type','Keywords','SID'

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

expand all

Link or link array, specified as an slreq.Link object.

Examples

expand all

This example shows how to find a link in a link set that matches the specified property value.

Open the CruiseRequirementsExample 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/Bdoc22b_2054784_2785512/bml.batserve.159352/MATLAB/Projects/examples/CruiseRequirementsExample5/documents/crs_req.slmx'
                Artifact: '/tmp/Bdoc22b_2054784_2785512/bml.batserve.159352/MATLAB/Projects/examples/CruiseRequirementsExample5/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]

Version History

Introduced in R2018a