find

Class: slreq.Reference
Package: slreq

Find referenced requirements

Syntax

refs = find(rs, 'Type', 'Reference', 'PropertyName', PropertyValue)

Description

refs = find(rs, 'Type', 'Reference', 'PropertyName', PropertyValue) finds and returns a referenced requirement or a set of referenced requirements refs in the requirements set rs specified by the properties matching PropertyName and PropertyValue. Property name matching is case-insensitive.

Input Arguments

expand all

Requirements set specified as an slreq.ReqSet object.

Output Arguments

expand all

Referenced requirements, returned as slreq.Reference objects.

Examples

Find Referenced Requirements That Have Matching Attribute Values

% Load a requirement set file
rs = slreq.load('C:\MATLAB\My_Requirement_Set_1.slreqx');

% Find all referenced requirements with Id R10 in the requirement set
matchedRefs = find(rs, 'Type', 'Reference', 'Id', 'R10')

matchedRefs = 

  Reference with properties:

          Keywords: [0×0 char]
          Artifact: 'Req_doc.docx'
                Id: 'R10'
           Summary: 'System overview'
       Description: ''
               SID: 3
            Domain: 'linktype_rmi_word'
    SynchronizedOn: 23-Jul-2017 12:47:23

Find Referenced Requirements by Using Regular Expression Matching

You can search for referenced requirements in your requirements sets by constructing regular expression search patterns by using the tilde (~) symbol.

% Load a requirement set file
rs = slreq.load('C:\MATLAB\My_Requirement_Set_1.slreqx');

% Find all referenced requirements that correspond to subsystems
subsystemReqs = find(rs, 'Type', 'Reference', 'Description', '~Subsystems(?i)\w*')

subsystemReqs = 

  1×40 Reference array with properties:

    Keywords
    Artifact
    Id
    Summary
    Description
    SID
    Domain
    SynchronizedOn
    ModifiedOn
For more information on constructing regular expression search patterns, see Steps for Building Expressions (MATLAB).

Introduced in R2018a