Main Content


Class: slreq.Link
Package: slreq

Get link custom attributes


val = getAttribute(myLink,name)


val = getAttribute(myLink,name) returns the custom attribute value of the custom attribute specified by name for the link myLink.

Input Arguments

expand all

Link, specified as an slreq.Link object.

Custom attribute name, specified as a character array.

Output Arguments

expand all

Custom attribute value, returned as a character array, double, logical, or datetime. The data type depends on the custom attribute type.


expand all

This example shows how to get the attribute value of a specified custom attribute for a link.

Load the crs_req requirement files, which contain links for a cruise control system. Find the link set.

ls = slreq.find('Type','LinkSet');

Create a links array containing all the links from link set ls. Get one link from the array. Get the attribute value of the custom attribute called Target Speed Change, which tracks whether linked requirements are related to incrementing or decrementing the speed.

linksArray = find(ls);
myLink = linksArray(7);
val = getAttribute(myLink,'Target Speed Change')
val = 


Clean up commands. Clear the open requirement sets and close the open models without saving the changes.

bdclose all;

Version History

Introduced in R2020b