Main Content

RequirementsTable

Configure Requirements Table blocks

Since R2022a

Description

Use RequirementsTable objects to configure Requirements Table blocks.

Creation

To create a RequirementsTable object:

Properties

expand all

Name of the Requirements Table block, specified as a string scalar or character vector.

Example: table.Name = "tableName" changes the block name to tableName

Data Types: char | string

This property is read-only.

Path of the Requirements Table block, returned as a character vector.

Data Types: char

Requirements Table block headers, specified as a structure array. Specify headers to add under the Precondition, Postcondition, and Action columns in the Requirements tab by setting the Preconditions, Postconditions, and Actions fields to a string vector or cell array of character vectors. Use a cell array to add multiple columns under the Precondition, Postcondition, and Action columns.

Example: table.RequirementHeaders.Preconditions = ["u1","",""] changes the Precondition column header where one header is u1 and the other two are empty.

Data Types: struct

Since R2024a

First-level requirement evaluation, specified as "independent", "exclusiveExhaustive", or "prioritized". For more information, see Specify Prioritized Evaluation for First-Level Hierarchy Requirements and Specify Exclusive Exhaustive Evaluation for First-Level Hierarchy Requirements.

Data Types: char

Object Functions

addRequirementRowAdd requirement to Requirements Table block
addAssumptionRowAdd assumption to Requirements Table block
addSymbolAdd data to Requirements Table block
clearClear row in Requirements Table block
getAssumptionRowsRetrieve assumptions in Requirements Table block
getRequirementRowsRetrieve requirements in Requirements Table block
findSymbolRetrieve data in Requirements Table block
hideAssumptionColumnHide Precondition column in Assumptions tab
hideRequirementColumnHide columns in Requirements tab
removeRowRemove Requirements Table block row
showAssumptionColumnShow Precondition column in Assumptions tab
showRequirementColumnShow columns in Requirements tab

Examples

collapse all

Create a new model called myModel that contains a Requirements Table block.

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

Change the name of the block to newTableName.

table.Name = "newTableName";

Create a new model called myModel that contains a Requirements Table block.

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

Specify three Precondition columns with empty headers.

table.RequirementHeaders.Preconditions = ["","",""];

Specify two Postcondition columns where one header is u1 and the other is empty.

table.RequirementHeaders.Postconditions = ["u1",""];

Specify two Action columns with the headers u2 and u3.

table.RequirementHeaders.Actions = ["u2","u3"];

This example shows how to create a Requirements Table block with three prioritized requirements.

Create a new model called myModel that contains a Requirements Table block, reqTable.

reqTable = slreq.modeling.create("myModel");

Add two additional requirements.

addRequirementRow(reqTable);
addRequirementRow(reqTable);

Set the evaluation of the first-level requirements to prioritized.

reqTable.ChildEvaluation = 'prioritized';

Close myModel.

bdclose("myModel");

Version History

Introduced in R2022a

expand all