Main Content

setAttribute

Class: slreq.Reference
Package: slreq

Set referenced requirement custom attributes

Syntax

setAttribute(ref, propertyName, propertyValue)

Description

setAttribute(ref, propertyName, propertyValue) sets a referenced requirement property. Use this method to set the values of custom attributes that you define for your requirements set.

Input Arguments

expand all

Referenced requirement specified as an slreq.Reference object.

Referenced requirement custom attribute name.

Example: 'Priority'

Referenced requirement custom attribute name, specified as a character vector.

Example: 'High', 'Medium'

Examples

Set Referenced Requirement Custom Attribute

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

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

Introduced in R2018a