主要内容

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

requirementRow

类: slreq.Requirement
命名空间: slreq

从需求中获取 Requirements Table 模块需求行

自 R2026a 起

说明

row = requirementRow(req) 返回与 req 指定的需求相对应的 Requirements Table 模块需求行,即 row

示例

示例

全部展开

本示例演示了如何检查一个需求是否是 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 对象。

输出参量

全部展开

Requirements Table 模块中的需求行,指定为 RequirementRow 对象。

如果需求 req 没有对应的 RequirementRow 对象,则该方法会返回一个错误。

版本历史记录

在 R2026a 中推出