Main Content

AssumptionRow

Assumptions in Requirements Table block

Since R2022a

Description

AssumptionRow objects represent assumptions in Requirements Table blocks. Use AssumptionRow objects to programmatically adjust the assumption properties.

Creation

There are several ways to create a AssumptionRow object:

  • Create a new assumption in a Requirements Table block by using the addAssumptionRow object function.

  • Create an assumption interactively in the Requirements Table block, then get the associated AssumptionRow object by using the getAssumptionRows object function.

Properties

expand all

Assumption row type, specified as 'normal', 'anyChildActive', or 'allChildrenActive'. For more information on assumption row type, see Specify Row Type in Requirements Table Blocks.

Data Types: char

This property is read-only.

Index of the assumption, returned as a character vector. When you create a new assumption, the software automatically assigns the assumption a unique index.

Precondition expression, specified as a cell array of a character vector. For more information on preconditions in assumptions, see Add Assumptions to Requirements.

Data Types: char | cell

Postcondition expression, specified as a cell array of a character vector. For more information on postconditions in assumptions, see Add Assumptions to Requirements.

Data Types: char | cell

Assumption summary text, specified as a string scalar or character vector. Use this property to add text to the Summary column in the Assumptions tab of the Requirements Table block.

Data Types: char | string

Object Functions

addChildAdd child requirement or assumption to Requirements Table block
getChildrenRetrieve child requirements and assumptions in Requirements Table block
clearClear row in Requirements Table block
removeRowRemove Requirements Table block row

Examples

collapse all

In a RequirementsTable object named reqTable, add two assumptions.

addAssumptionRow(reqTable);
addAssumptionRow(reqTable);

Retrieve the AssumptionRow objects.

aRow = getAssumptionRows(reqTable);

Set the preconditions for the assumptions.

aRow(1).Preconditions = {'u1 > 1'};
aRow(2).Preconditions = {'u1 > 0'};
aRow(3).Preconditions = {'u1 > -1'};

Set the postconditions for the assumptions.

aRow(1).Postconditions = {'u2 > 1'};
aRow(2).Postconditions = {'u2 > 0'};
aRow(3).Postconditions = {'u2 < -1'};

Version History

Introduced in R2022a

expand all