主要内容

requirement

Get requirement from Requirements Table block requirement row

Since R2026a

Description

req = requirement(row) returns the requirement, req, that corresponds to the Requirements Table block row specified by row.

example

Examples

collapse all

This example shows how to get an slreq.Requirement object from a corresponding RequirementRow object.

Load the duration_column_example_model model.

model = "duration_column_example_model";
load_system(model)

Find the Requirements Table block in the model.

table = slreq.modeling.find(model);

Get the requirement rows as an array of RequirementRow objects.

rows = getRequirementRows(table);

Get the slreq.Requirement object from the first row in the Requirements Table block.

reqRow = rows(1);
req = requirement(reqRow)
req = 
  Requirement with properties:

            Type: 'Functional'
              Id: '#2'
         Summary: 'Requirement 1'
     Description: 'Requirement 1'
        Keywords: {}
       Rationale: ''
       CreatedOn: 18-Mar-2022 12:54:04
       CreatedBy: 'ssatinov'
      ModifiedBy: 'ssatinov'
    IndexEnabled: 1
     IndexNumber: []
             SID: 2
    FileRevision: 1
      ModifiedOn: 18-Mar-2022 12:54:04
           Dirty: 0
        Comments: [0×0 struct]
           Index: '1'

Input Arguments

collapse all

Requirement row in the Requirements Table block, specified as a RequirementRow object.

Output Arguments

collapse all

Requirement, specified as an slreq.Requirement object.

Version History

Introduced in R2026a