importProfile
类: slreq.ReqSet
命名空间: slreq
语法
importProfile(rs,fileName)
输入参数
rs
— 需求集
slreq.ReqSet
对象
需求集,指定为 slreq.ReqSet
对象。
fileName
— 配置文件名
字符串标量 | 字符向量
配置文件名,指定为字符串标量或字符向量。
示例: "myProfile.xml"
示例
导入配置文件并获取和设置原型属性
此示例显示如何将配置文件分配给需求集以及如何获取和设置需求的原型属性值。
打开 ShortestPath
工程。
openProject("ShortestPath");
加载shortest_path_tests_reqs
需求集。
rs = slreq.load("shortest_path_tests_reqs");
将 TestReqProfile
配置文件分配给 shortest_path_tests_reqs
需求集。
importProfile(rs,"TestReqProfile");
查找索引为 2.1.1
的需求。将 TestRequirement
原型应用于需求。
testReq = find(rs,Index="2.1.1"); testReq.Type = "TestReqProfile.TestRequirement";
获取Reviewed
原型属性的值。
val = getAttribute(testReq,"TestReqProfile.TestRequirement.Reviewed")
val = 0
将 Reviewed
原型属性的值设置为 1
。
setAttribute(testReq,"TestReqProfile.TestRequirement.Reviewed",1)
提示
要将配置文件分配给链接集,请使用
slreq.LinkSet
的importProfile
方法。
版本历史记录
在 R2022b 中推出
另请参阅
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)