Main Content

slreq.modeling.findRequirementRow

Find rows in Requirements Table blocks

Since R2026a

Description

row = slreq.modeling.findRequirementRow(table,index) returns the Requirements Table block row in the table, table, that has the index, index.

row = slreq.modeling.findRequirementRow(tableName,index) returns the Requirements Table block row in the table tableName, that has the index, index. Use this syntax to check all loaded models.

row = slreq.modeling.findRequirementRow(modelName,index) returns the Requirements Table block row in the model, modelName, that has the index, index. Use this syntax if the model has one Requirements Table block.

example

row = slreq.modeling.findRequirementRow(modelName,tableName,index) returns the Requirements Table block row in the Requirements Table block tableName, in the model, modelName, that has the index specified by index.

row = slreq.modeling.findRequirementRow(tablePath,index) returns the Requirements Table block row in the Requirements Table block specified by tablePath that has the index, index.

row = slreq.modeling.findRequirementRow(table,summary) returns the Requirements Table block row in the table, table, that has the summary, summary.

example

row = slreq.modeling.findRequirementRow(tableName,summary) returns the Requirements Table block row in the table tableName, that has the summary, summary. Use this syntax to check all loaded models.

row = slreq.modeling.findRequirementRow(modelName,summary) returns the Requirements Table block row in the model, modelName, that has the summary, summary. Use this syntax if the model has one Requirements Table block.

row = slreq.modeling.findRequirementRow(modelName,tableName,summary) returns the Requirements Table block row in the Requirements Table block tableName, in the model, modelName, that has the summary specified by summary.

row = slreq.modeling.findRequirementRow(tablePath,summary) returns the Requirements Table block row in the Requirements Table block specified by tablePath, that has the summary, summary.

Examples

collapse all

This example shows how to find a requirement row in a Requirements Table block by using the requirement index.

Load the model.

model = "duration_column_example_model";
load_system(model)

Get the requirement row with index 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'

This example shows how to find a requirement row in a Requirements Table block by using the requirement summary.

Load the model.

model = "duration_column_example_model";
load_system(model)

Get the requirement row with the summary 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'

Input Arguments

collapse all

Requirements Table block, specified as a RequirementsTable object.

Requirement row index, specified as a string scalar or character vector.

Data Types: char | string

Requirement Table block name, specified as a string scalar or character vector.

Model name, specified as a string scalar or character vector.

Data Types: char | string

Requirements Table block path, specified as a string scalar or character vector.

Data Types: char | string

Requirement row summary, specified as a string scalar or character vector.

Data Types: char | string

Output Arguments

collapse all

Requirements Table block row, returned as a RequirementRow object.

Version History

Introduced in R2026a