Main Content


Class: slreq.Requirement
Package: slreq

Set requirement custom attributes


setAttribute(req, propertyName, propertyValue)


setAttribute(req, propertyName, propertyValue) sets a requirement property.

Input Arguments

expand all

Requirement specified as an slreq.Requirement object.

Requirement property name.

Example: 'SID', 'CreatedOn', 'Summary'

Requirement property value.

Example: 'Test Requirement', 'R1.3.1'


Set Requirement Custom Attributes

% Load a requirement set file and get the handle to one requirement 
rs = slreq.load('C:\MATLAB\My_Requirements_Set_1.slreqx');
req1 = find(rs, 'Type', 'Requirement', 'ID', 'R2.1');

% Set the Priority (custom attribute) of req1
setAttribute(req1, 'Priority', 'Low');


req1 = 

  Requirement with properties:

              Id: 'R2.1'
         Summary: 'Controller Requirement'
        Keywords: [0×0 char]
     Description: ''
       Rationale: ''
             SID: 21
       CreatedBy: 'Jane Doe'
       CreatedOn: 27-Feb-2014 10:15:38
      ModifiedBy: 'John Doe'
      ModifiedOn: 02-Aug-2017 13:49:40
    FileRevision: 43
           Dirty: 1
        Comments: [0×0 struct]
        Priority: Low

Version History

Introduced in R2018a