主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

find

类: slreq.Justification
命名空间: slreq

查找父级申述的子级

语法

childJusts = find(jt,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN)

说明

childJusts = find(jt,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN) 查找并返回父级理由 jt 的子级理由 childJusts,这些子级理由与 PropertyNamePropertyValue 指定的属性相匹配。

输入参数

全部展开

申述,指定为 slreq.Justification 对象。

申述属性名称,指定为字符向量。请参阅 slreq.Justification属性 部分中的有效属性名称。

示例: 'Type','Keywords','SID'

申述属性值,指定为字符向量、字符数组、datetime 值、标量、logical 或结构体数组。数据类型取决于指定的 propertyName。请参阅 slreq.Justification属性 部分中的有效属性值。

输出参量

全部展开

子申述,以 slreq.Justification 对象形式返回。

示例

全部展开

此示例显示如何查找与属性值匹配的子申述。

加载描述巡航控制系统的 crs_req_justs 需求文件,并将其分配给变量。找到索引为 5 的申述,因为该申述有子申述。

rs = slreq.load("crs_req_justs");
parentReq = find(rs,"Type","Justification","Index","5");

查找在修订版 parentReq 中修改的 1 的子理由。

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

查找在修订版 parentReq 中修改的 1 的子论证,其摘要为 Non-functional requirement

childReqs2 = find(parentReq,"FileRevision",1, ...
    "Summary","Non-functional requirement")
childReqs2 = 
  Justification with properties:

              Id: '#72'
         Summary: 'Non-functional requirement'
     Description: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">↵<html><head><meta name="qrichtext" content="1" /><style type="text/css">↵p, li { white-space: pre-wrap; }↵</style></head><body style=" font-family:'Helvetica'; font-size:8pt; font-weight:400; font-style:normal;">↵<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">A non-functional requirement that cannot be associated with a model element.</span></p></body></html>'
        Keywords: {}
       Rationale: ''
       CreatedOn: 27-Feb-2017 10:34:22
       CreatedBy: 'itoy'
      ModifiedBy: 'asriram'
    IndexEnabled: 1
     IndexNumber: []
             SID: 72
    FileRevision: 1
      ModifiedOn: 03-Aug-2017 17:14:44
           Dirty: 0
        Comments: [0×0 struct]
           Index: '5.1'

提示

  • 要搜索已加载的 Requirements Toolbox 对象,请使用 slreq.find 函数。

  • 要搜索需求的子项,请使用 slreq.Requirementfind 方法

  • 要搜索需求集的子项,请使用 slreq.ReqSetfind 方法。

  • 要搜索链接集的子项,请使用 slreq.LinkSetfind 方法。

  • 要搜索引用的子项,请使用 slreq.Referencefind 方法。

版本历史记录

在 R2018b 中推出