Main Content

find

Class: slreq.Requirement
Namespace: slreq

Find children of parent requirements

Syntax

childReqs = find(req,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN)

Description

childReqs = find(req,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN) finds and returns child requirements childReqs of the parent requirement req that match the properties specified by PropertyName and PropertyValue.

Input Arguments

expand all

Requirement, specified as an slreq.Requirement object.

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

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

Requirement 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.Requirement.

Output Arguments

expand all

Child requirements, returned as slreq.Requirement objects.

Examples

expand all

This example shows how to find child requirements that match property values.

Load the crs_req_func_spec requirement file, which describes a cruise control system, and assign it to a variable. Find the requirement with index 4, as this requirement has child requirements.

rs = slreq.load("crs_req_func_spec");
parentReq = find(rs,"Type","Requirement","Index","4");

Find the child requirements of parentReq that were modified in revision 1.

childReqs1 = find(parentReq,"FileRevision",1)
childReqs1=1×10 Requirement array with properties:
    Type
    Id
    Summary
    Description
    Keywords
    Rationale
    CreatedOn
    CreatedBy
    ModifiedBy
    IndexEnabled
    IndexNumber
    SID
    FileRevision
    ModifiedOn
    Dirty
    Comments
    Index

Find all the child requirements of parentReq that were modified in revision 1 and are Functional type requirements.

childReqs2 = find(parentReq,"FileRevision",1,"Type","Functional")
childReqs2=1×10 Requirement array with properties:
    Type
    Id
    Summary
    Description
    Keywords
    Rationale
    CreatedOn
    CreatedBy
    ModifiedBy
    IndexEnabled
    IndexNumber
    SID
    FileRevision
    ModifiedOn
    Dirty
    Comments
    Index

Tips

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

  • To search the children of a requirements set, use the find method of slreq.ReqSet.

  • 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