setAttribute
类: slreq.Reference
命名空间: slreq
设置引用的需求自定义属性
语法
setAttribute(ref,propertyName,propertyValue)
说明
setAttribute(
将引用的需求属性或自定义属性 ref
,propertyName
,propertyValue
)propertyName
的值设置为 propertyValue
指定的值。
输入参数
ref
— 引用的需求
slreq.Reference
对象
引用的需求,指定为 slreq.Reference
对象。
propertyName
— 引用的需求属性或自定义属性名称
字符串标量 | 字符向量
引用的需求属性或自定义属性名称,指定为字符串标量或字符向量。
示例: "Priority"
propertyValue
— 引用需求自定义属性值
字符串标量 | 字符向量 | double
| logical
| datetime
引用的需求属性或自定义属性值,指定为字符串标量、字符向量、double
、logical
或 datetime
。数据类型取决于属性类型或自定义属性类型。
示例: "High"
示例
设置引用需求自定义属性值
此示例显示如何设置引用需求的自定义属性的值。
加载名为 My_Requirement_Set
的需求集。
rs = slreq.load('C:\MATLAB\My_Requirements_Set.slreqx');
查找 ID 为 R20.1
的引用需求。
ref1 = find(rs,Type="Reference",ID="R20.1");
将引用需求的 Priority
自定义属性设置为 Low
。
setAttribute(ref1,"Priority","Low");
版本历史记录
在 R2018a 中推出
另请参阅
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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)