Main Content


Class: slreq.Requirement
Package: slreq

Add requirement to requirements set


req = add(reqObj, 'PropertyName', PropertyValue)


req = add(reqObj, 'PropertyName', PropertyValue) adds a requirement req to a requirements object reqObj with properties and custom attributes specified by PropertyName and PropertyValue.

Input Arguments

expand all

Requirements set or requirement objects, specified as an slreq.ReqSet or as an slreq.Requirement object.

Output Arguments

expand all

The requirement that was added, returned as an slreq.Requirement object.


Add a Requirement to a Requirements Set

% Load a requirements set file

rs = slreq.load('C:\MATLAB\My_Requirements_Set_1.slreqx');

% Add a top-level requirement to the requirements set
req1 = add(rs, 'Id', '5', 'Summary', 'Additional Requirement');

% Add a child requirement to the requirement req1
req2 = add(req1, 'Id', '5.1', 'Summary', 'Additional Child Requirement');

Introduced in R2018a