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.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- 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)