addRequirementRow
Syntax
Description
adds a requirement to the Requirements
Table block specified by RequirementRow
= addRequirementRow(reqTable
)reqTable
.
adds a requirement using one or more name-value arguments.RequirementRow
= addRequirementRow(reqTable
,Name=Value
)
Examples
Add a Requirement to a Requirements Table Block
Create a Requirements Table block and retrieve the
RequirementsTable
object.
table = slreq.modeling.create("myModel");
Add a requirement to the block.
row = addRequirementRow(table);
Add a Requirement with Preconditions, Postconditions, and Actions
Create a Requirements Table block and retrieve the
RequirementsTable
object.
table = slreq.modeling.create("myModel");
Add a requirement to the block with expressions in the Precondition, Postcondition, and Action columns.
row = addRequirementRow(table,Preconditions={'u1 > 1'},... Postcoditions={'y1 > 0'},Actions={'y2 = 1'});
Input Arguments
reqTable
— Requirements Table block
RequirementsTable
object
Requirements Table block, specified as a
RequirementsTable
object.
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: addRequirementRow(table,Preconditions={'u1 > 0'})
adds a
requirement to a Requirements Table block with a precondition u1 >
0
.
Actions
— Action expressions
{''}
(default) | cell array of character vectors
Action expressions, specified as a cell array of character vectors. For more information on actions, see Use a Requirements Table Block to Create Formal Requirements.
Data Types: char
| cell
Duration
— Duration expression
""
(default) | string scalar | character vector
Duration expression, specified as a string scalar or character vector. For more information on the duration, see Control Requirement Execution by Using Temporal Logic.
Data Types: char
| string
Preconditions
— Precondition expressions
{''}
(default) | cell array of character vectors
Precondition expressions, specified as a cell array of character vectors. For more information on preconditions, see Use a Requirements Table Block to Create Formal Requirements.
Example: addRequirementRow(table,Preconditions={'u1 > 0','','u3 >
0'})
adds a requirement to a Requirements Table block with
u1 > 0
in the first Precondition column,
nothing in the second Precondition column, and u3 >
0
in the third Precondition column.
Data Types: char
| cell
Postconditions
— Postcondition expressions
{''}
(default) | cell array of character vectors
Postcondition expressions, entered as a string array or cell array of character vectors. For more information on postconditions, see Use a Requirements Table Block to Create Formal Requirements.
Example: addRequirementRow(table,Postconditions={'u1 > 0','','u3 >
0'})
adds a requirement to a Requirements Table block with
u1 > 0
in the first Postcondition column,
nothing in the second Postcondition column, and u3 >
0
in the third Postcondition column.
Data Types: char
| cell
rowType
— Requirement type
"normal"
(default) | "default"
| "anyChildActive"
| "allChildrenActive"
Requirement type, specified by one of these values:
Value | Description |
---|---|
"normal" | Creates a normal requirement with all of the available properties. |
"default" | Creates a default semantic requirement. Default requirements cannot have preconditions. |
"anyChildActive" | Creates an Any Child Active semantic requirement. The parent requirement cannot have preconditions, and the children cannot have postconditions or actions. |
"allChildrenActive" | Creates an All Child Active semantic requirement. The parent requirement cannot have preconditions, and the children cannot have postconditions or actions. |
You can create normal requirements or semantic requirements. For more information on semantic requirements and assumptions, see Specify Row Type in Requirements Table Blocks. If you do not include this name-value pair, the function creates a normal requirement.
Data Types: enumerated
Summary
— Requirement summary text
""
(default) | string scalar | character vector
Requirement summary text, specified as a string scalar or character vector. Use this name-value argument to add text to the Summary column in the Requirements tab of the Requirements Table block.
Data Types: char
| string
Output Arguments
RequirementRow
— Requirement
RequirementRow
object
Requirement, returned as a RequirementRow
object.
Version History
Introduced in R2022a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)