Main Content

find

Class: slreq.ReqSet
Namespace: slreq

Find requirements in requirement 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 requirement set rs specified by the properties matching PropertyName and PropertyValue. Property name matching is case-insensitive.

Input Arguments

expand all

Requirement set, specified as a slreq.ReqSet object.

Output Arguments

expand all

Requirement, returned as an slreq.Requirement object.

Examples

expand all

  1. Load a requirement set file.

    rs = slreq.load("C:\MATLAB\My_Requirements_Set_1.slreqx");
  2. Find editable requirements in the requirement set.

    reqs = find(rs,"Type","Requirement");
  3. Find referenced requirements in the requirement set.

    refs = find(rs,"Type","Reference");
  4. Find requirements with a certain ID.

    matchedReqs = find(rs,"ID","R1.1");

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

  1. Load a requirement set file.

    rs = slreq.load("C:\MATLAB\My_Requirements_Set_1.slreqx");
  2. Find 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

Tips

  • To search the loaded Requirements Toolbox objects, use the slreq.find function.

  • To search the children of a requirement, use the find method of slreq.Requirement

  • To search the children of a link set, use the find method of slreq.LinkSet.

  • To search the children of a reference, use the find method of slreq.Reference.

  • To search the children of a justification, use the find method of slreq.Justification.

Version History

Introduced in R2018a