activate
说明
示例
创建视图并将其应用到需求编辑器
此示例显示如何创建视图并将其应用于需求编辑器和需求透视图。
打开 myAddRequirements
需求集,其中包含 Type
设置为 Functional
的需求。
rs = slreq.open("myAddRequirements");
创建一个名为 NewView
的视图。
myView = slreq.View.create("NewView")
myView = View with properties: Name: 'NewView' ReqFilter: '' LinkFilter: '' Host: ''
设置需求过滤器以仅显示将 Type
设置为 Container
的需求。
myView.ReqFilter = "{'ReqType','Container'};"
myView = View with properties: Name: 'NewView' ReqFilter: '{'ReqType','Container'};' LinkFilter: '' Host: ''
检查视图是否有效。
tf = isValid(myView)
tf = logical
1
将视图应用到需求编辑器和需求透视图。
activate(myView)
确认活动视图是 NewView
。
appliedView = slreq.View.getActiveView
appliedView = View with properties: Name: 'NewView' ReqFilter: '{'ReqType','Container'};' LinkFilter: '' Host: ''
myAddRequirements
需求集不包含任何将 Type
设置为 Container
的需求,因此所有需求都被过滤掉。
清除已加载的需求集和链接集并关闭需求编辑器。
slreq.clear;
输入参数
view
— 查看设置
slreq.View
对象
查看设置,指定为 slreq.View
对象。
版本历史记录
在 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)