Main Content

getRequirementRows

Retrieve requirements in Requirements Table block

Since R2022a

Description

RequirementRows = getRequirementRows(reqTable) returns the top-level requirement rows of the Requirements Table block specified by reqTable.

example

RequirementRows = getRequirementRows(reqTable,level) returns the requirement rows from the top-level to the level specified by level. (since R2026a)

example

Examples

collapse all

Retrieve the RequirementsTable object from a model named myModel.

table = slreq.modeling.find("myModel");

Retrieve the requirements as an array of RequirementRow objects.

row = getRequirementRows(table);

Since R2026a

This example shows how to get all of the requirement rows in a Requirements Table block.

Load the temporal_logic_operators_example model.

model = "temporal_logic_operators_example";
load_system(model)

Find the Requirements Table block in the model.

table = slreq.modeling.find(model);

The requirement row hierarchy in the Requirements Table block is two levels deep. Get all of the requirement rows in the model.

allRows = getRequirementRows(table,2)
allRows=1×6 RequirementRow array with properties:
    Actions
    Duration
    ChildEvaluation
    RowType
    Index
    Preconditions
    Postconditions
    Summary

Input Arguments

collapse all

Requirements Table block, specified as a RequirementsTable object.

Lowest level of requirement rows to return, specified as an integer.

To return the requirement rows in the top level and their children, specify level as 2. If you specify a value for level that is greater than the number of hierarchy levels in the Requirements Table block, the function returns all the requirement rows.

Output Arguments

collapse all

Requirement rows in the Requirements Table block, returned as an array of RequirementRow objects.

Version History

Introduced in R2022a

expand all