addChild
Description
Examples
Create a Requirements Table block and retrieve the
RequirementsTable object.
table = slreq.modeling.create("myModel");New Requirements Table blocks start with one requirement. Find the
RequirementRow object that corresponds to the requirement by using
the getRequirementRows
function.
row = getRequirementRows(table);
Add a child to the requirement.
childReq = addChild(row);
Create a Requirements Table block and retrieve the
RequirementsTable object.
table = slreq.modeling.create("myModel");Add an assumption to the block by using the addAssumptionRow function.
row = addAssumptionRow(table);
Add a child with expressions in the Precondition and Postcondition columns to the assumption.
child = addChild(row,Preconditions={'u1 > 1'},...
Postcoditions={'y1 > 0'});Input Arguments
Requirement or assumption in a Requirements Table block, specified as a
RequirementRow or AssumptionRow object. To retrieve the row, use getRequirementRows, getAssumptionRows, or getChildren.
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: newChild = addChild(row,Preconditions={'u1 >
1'},Duration="5") returns a child requirement from the
RequirementRow object row that has the precondition
u1 > 1 and a duration equal to 5. This example
produces an error if row is a
AssumptionRow, because assumptions do not have a duration
property.
Action expressions, specified as a cell array of character vectors. You can only
specify this property if row is a RequirementRow
object. For more information on actions, see Use a Requirements Table Block to Create Formal Requirements.
Data Types: cell | char
Duration expression, specified as a string scalar or character vector. You can
only specify this property if row is a
RequirementRow object. For more information on the duration, see
Control Requirement Execution by Using Temporal Logic.
Data Types: char | string
Precondition expressions, specified as a cell array of character vectors. If
row is an assumption, you can specify only one precondition per
child. For more information on preconditions, see Use a Requirements Table Block to Create Formal Requirements.
Data Types: cell | char
Postcondition expressions, specified as a cell array of character vectors. If
row is an assumption, you can specify only one postcondition per
child. For more information on postconditions, see Use a Requirements Table Block to Create Formal Requirements.
Data Types: cell | char
Row type, specified as one of these values:
| Value | Description |
|---|---|
"normal" | Creates a normal child row with all of the available properties. |
"default" | Creates a default semantic child row. Default rows cannot have a precondition. |
"anyChildActive" | Creates a semantic child row where any of the child rows can be active. The children of the added row cannot have postconditions or actions, and the added row cannot have preconditions. See Specify Row Type in Requirements Table Blocks. |
"allChildrenActive" | Creates a semantic child row where all of the child rows must be active. The children of the added row cannot have postconditions or actions, and the added row cannot have preconditions. See Specify Row Type in Requirements Table Blocks. |
If you do not include this name-value pair, the function creates a normal row.
Data Types: enumerated
Child row 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 or Assumptions tabs of the Requirements Table block.
Data Types: char | string
Output Arguments
Child requirement or assumption, returned as the same object type specified by the
input argument row. For example, if row is a
RequirementRow, newChild is a
RequirementRow. For more information on requirement hierarchies in
Requirements Table blocks, see Establish Hierarchy in Requirements Table Blocks.
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.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)