主要内容

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

isRequirementRow

类: slreq.Requirement
命名空间: slreq

检查该需求是否是 Requirements Table 模块中的一行

自 R2026a 起

说明

tf = isRequirementRow(req) 用于检查 req 指定的需求是否是 Requirements Table 模块中的需求行。

示例

示例

全部展开

本示例演示了如何检查一个需求是否是 Requirements Table 模块中的需求行,并获取相应的 RequirementRow 对象。

加载模型以加载需求集。

load_system("duration_column_example_model.slx");

查找已加载的需求。

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

检查第一个需求是否是 Requirements Table 模块中的需求行。

isRequirementRow(reqs(1))
ans = logical
   1

获取与第一个需求相对应的需求行。

requirementRow(reqs(1))
ans = 
  RequirementRow with properties:

            Actions: {'y = 1'}
           Duration: '2'
    ChildEvaluation: 'independent'
            RowType: 'normal'
              Index: '1'
      Preconditions: {'u >= 0'}
     Postconditions: {''}
            Summary: 'Requirement 1'

输入参数

全部展开

需求,指定为 slreq.Requirement 对象。

输出参量

全部展开

结果为真或假,以数据类型 logical10 形式返回。

版本历史记录

在 R2026a 中推出