move
Class: slreq.Justification
Namespace: slreq
Syntax
tf = move(jt1,location,jt2)
Description
moves justification tf
= move(jt1
,location
,jt2
)jt1
under, before, or after justification
jt2
depending on the location specified by
location
. The function returns 1
if the move is
executed without error.
Input Arguments
jt1
— Justification to move
slreq.Justification
object
Justification to move, specified as an slreq.Justification
object.
location
— Justification move location
'under'
| 'before'
| 'after'
Justification move location, specified as 'under'
,
'before'
, or 'after'
.
jt2
— Justification
slreq.Justification
object
Justification, specified as an slreq.Justification
object.
Output Arguments
tf
— Paste success status
0
|
1
Paste success status, returned as a
0
or 1
of data type
logical
.
Examples
Move a Justification
This example shows how to move a justification under, before, or after another justification.
Load the crs_req_justs
requirement file, which describes a cruise control system, and assign it to a variable. Find two justifications by index. The first justification will be moved in relation to the second justification.
rs = slreq.load('crs_req_justs'); jt1 = find(rs,'Type','Justification','Index','5.1'); jt2 = find(rs,'Type','Justification','Index','5.2');
Move Under a Justification
Move the first justification, jt1
, under the second justification, jt2
. The first justification becomes the last child justification of justification jt2
, and jt2
moves up one in the hierarchy, which you can verify by checking the index of jt1
and jt2
. The old indices of jt1
and jt2
were 5.1
and 5.2
, respectively.
tf = move(jt1,'under',jt2);
jt1.Index
ans = '5.1.3'
jt2.Index
ans = '5.1'
Move Before a Justification
Move the first justification, jt1
, before the second justification, jt2
. Confirm that the justification was moved correctly by checking the indices of jt1
and jt2
. The indices of jt1
and jt2
are now the same as they were originally: 5.1
and 5.2
, respectively.
tf = move(jt1,'before',jt2);
jt1.Index
ans = '5.1'
jt2.Index
ans = '5.2'
Move After a Justification
Move the first justification, jt1
, after the second justification, jt2
. When you move justification jt1
down in the hierarchy, justification jt2
also moves up, which you can verify by checking the indices of jt1
and jt2
.
tf = move(jt1,'after',jt2);
jt1.Index
ans = '5.2'
jt2.Index
ans = '5.1'
Version History
Introduced in R2020b
See Also
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 (한국어)