Main Content

find

Class: slreq.ReqSet
Package: slreq

Find requirements in requirements set that have matching attribute values

Syntax

myReq = find(rs, 'PropertyName', 'PropertyValue')

Description

myReq = find(rs, 'PropertyName', 'PropertyValue') finds and returns an slreq.Requirement object myReq 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 a slreq.ReqSet object.

Output Arguments

expand all

Requirement, returned as an slreq.Requirement object.

Examples

Find Requirements That Have Matching Attribute Values

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

% Find all editable requirements in the requirement set
allReqs = find(rs, 'Type', 'Requirement');

% Find all referenced requirements in the requirement set
allRefs = find(rs, 'Type', 'Reference');

% Find all requirements with a certain ID
matchedReqs = find(rs, 'ID', 'R1.1');

Find Requirements by Using Regular Expression Matching

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

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

% Find all requirements that correspond to the controller
controllerReqs = find(rs, 'Type', 'Requirement', 'Summary', '~Controller(?i)\w*')

controllerReqs = 

  1×19 Requirement array with properties:

    Id
    Summary
    Keywords
    Description
    Rationale
    SID
    CreatedBy
    CreatedOn
    ModifiedBy
    ModifiedOn
    FileRevision
    Dirty
    Comments
For more information on constructing regular expression search patterns, see Steps for Building Expressions.

Introduced in R2018a