主要内容

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

slreq.modeling.findRequirementRow

查找 Requirements Table 模块中的行

自 R2026a 起

说明

row = slreq.modeling.findRequirementRow(table,index) 返回表 table 中索引为 indexRequirements Table 模块行。

row = slreq.modeling.findRequirementRow(tableName,index) 返回表 tableName 中索引为 indexRequirements Table 模块行。使用此语法检查所有已加载的模型。

row = slreq.modeling.findRequirementRow(modelName,index) 返回模型 modelName 中索引为 indexRequirements Table 模块行。如果模型中包含一个 Requirements Table 模块,请使用此语法。

示例

row = slreq.modeling.findRequirementRow(modelName,tableName,index) 返回 Requirements Table 模块 tableNamemodelName 模型的 Requirements Table 模块行,该行的索引由 index 指定。

row = slreq.modeling.findRequirementRow(tablePath,index) 返回由 tablePath 指定的 Requirements Table 模块中索引为 indexRequirements Table 模块行。

row = slreq.modeling.findRequirementRow(table,summary) 返回表 table 中包含摘要数据 summaryRequirements Table 模块行。

示例

row = slreq.modeling.findRequirementRow(tableName,summary) 返回表 tableName 中包含摘要 summaryRequirements Table 模块行。使用此语法检查所有已加载的模型。

row = slreq.modeling.findRequirementRow(modelName,summary) 返回模型 Requirements TablemodelName 包含摘要 summary 的模块行。如果模型中包含一个 Requirements Table 模块,请使用此语法。

row = slreq.modeling.findRequirementRow(modelName,tableName,summary) 返回 Requirements Table 模块中 tableName 模块的 Requirements Table 行,该模块位于模型 modelName 中,且该模型具有由 summary 指定的摘要。

row = slreq.modeling.findRequirementRow(tablePath,summary) 返回由 tablePath 指定的 Requirements Table 模块中的 Requirements Table 模块行,该行的摘要为 summary

示例

全部折叠

本示例演示了如何使用需求索引在 Requirements Table 模块中查找一条需求行。

加载模型。

model = "duration_column_example_model";
load_system(model)

获取索引为 1 的需求行。

reqRow1 = slreq.modeling.findRequirementRow(model,"1")
reqRow1 = 
  RequirementRow with properties:

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

本示例演示了如何利用需求摘要在 Requirements Table 模块中查找某条需求行。

加载模型。

model = "duration_column_example_model";
load_system(model)

获取摘要为 Requirement 1 的需求行。

reqRow1 = slreq.modeling.findRequirementRow(model,"Requirement 1")
reqRow1 = 
  RequirementRow with properties:

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

输入参数

全部折叠

Requirements Table 模块,指定为 RequirementsTable 对象。

需求行索引,指定为字符串标量或字符向量。

数据类型: char | string

Requirements Table 模块名称,指定为字符串标量或字符向量。

模型名称,指定为字符串标量或字符向量。

数据类型: char | string

Requirements Table 模块路径,指定为字符串标量或字符向量。

数据类型: char | string

需求行摘要,指定为字符串标量或字符向量。

数据类型: char | string

输出参量

全部折叠

Requirements Table 模块行,以 RequirementRow 对象形式返回。

版本历史记录

在 R2026a 中推出