Main Content

moveUp

Class: slreq.Requirement
Package: slreq

Move requirement up in hierarchy

Syntax

tf = moveUp(req)

Description

tf = moveUp(req) moves the requirement req up one spot in the hierarchy, and returns 1 if the move is successful. The requirement req cannot be moved to a new level in the hierarchy.

Input Arguments

expand all

Requirement, specified as an slreq.Requirement object.

Output Arguments

expand all

Paste success status, returned as a 1 or 0 of data type logical.

Examples

expand all

This example shows how to move a requirement up in the hierarchy.

Load the crs_req_func_spec requirement file, which describes a cruise control system, and assign it to a variable. Find the requirement with index 3.4.

rs = slreq.load('crs_req_func_spec');
req1 = find(rs,'Type','Requirement','Index','3.4');

Move the requirement up one spot in the hierarchy. Confirm the move by checking the success status, tf1, and the index.

tf1 = moveUp(req1)
tf1 = logical
   1

req1.Index
ans = 
'3.3'

Find the requirement with index 3.1. This requirement is already at the top of its level in the hierarchy and cannot be moved up further, which you can verify by trying to move it up. Confirm that the move failed by checking the success status, tf2, and the index.

req2 = find(rs,'Type','Requirement','Index','3.1');
tf2 = moveUp(req2)
tf2 = logical
   0

req2.Index
ans = 
'3.1'

Cleanup

Clear the open requirement sets and link sets, and close the open models without saving changes.

slreq.clear;
bdclose all;
Introduced in R2020b