getAttribute
Class: slreq.Reference
Package: slreq
Get referenced requirement custom attributes
Syntax
val = getAttribute(ref,propertyName)
Description
returns the value of the referenced requirement property or custom attribute specified
by val
= getAttribute(ref
,propertyName
)propertyName
.
Input Arguments
ref
— Referenced requirement
slreq.Reference
object
Referenced requirement, specified as a slreq.Reference
object.
propertyName
— Referenced requirement property or custom attribute name
string scalar | character vector
Referenced requirement property or custom attribute name, specified as a string scalar or character vector.
Example: "Priority"
Output Arguments
val
— Referenced requirement property or custom attribute value
string scalar | character vector | double
| logical
| datetime
Referenced requirement property or custom attribute value, returned as a
string scalar, character vector, double
,
logical
, or datetime
. The data type
depends on the property type or custom attribute type.
Example: "High"
Examples
Get Referenced Requirement Custom Attribute Value
This example shows how to get the value of a custom attribute for a referenced requirement.
Load a requirement set called
My_Requirement_Set
.
rs = slreq.load('C:\MATLAB\My_Requirements_Set.slreqx');
Find the referenced requirement with ID
R20.1
.
ref1 = find(rs,Type="Reference",ID="R20.1");
Get the value of the Priority
custom attribute for the
referenced requirement.
val = getAttribute(ref1,"Priority")
val = "Low"
Version History
Introduced in R2018a
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)