find
类: slreq.Reference
命名空间: slreq
查找父级引用需求的子级
语法
childRefs = find(ref,'PropertyName1',PropertyValue1,...,'PropertyNameN',PropertyValueN)
说明
查找并返回与 childRefs
= find(ref
,'PropertyName1'
,PropertyValue1
,...,'PropertyNameN'
,PropertyValueN
)PropertyName
和 PropertyValue
指定的属性匹配的父引用需求ref
的子引用需求 childRefs
。
输入参数
ref
— 引用的需求
slreq.Reference
对象
引用的需求,指定为 slreq.Reference
对象。
PropertyName
— 引用属性
字符向量
引用属性名称,指定为字符向量。请参阅 slreq.Reference
的 属性 部分中的有效属性名称。
示例: 'Type','Keywords','SID'
PropertyValue
— 参考属性值
字符向量 | 字符数组 | datetime
值 | 标量 | logical
| 结构体数组
引用属性值,指定为字符向量、字符数组、datetime
值、标量、logical
或结构体数组。数据类型取决于指定的 propertyName
。请参阅 slreq.Reference
的 属性 部分中的有效属性值
输出参量
childRefs
— 子引用需求
slreq.Reference
对象 | slreq.Reference
对象数组
子引用需求,以 slreq.Reference
对象形式返回。
示例
查找子项引用需求
此示例显示如何查找与属性值匹配的子引用需求。
加载描述巡航控制系统的crs_req
需求文件,并将其分配给变量。查找索引为 3
的引用需求,因为此引用需求具有子引用需求。
rs = slreq.load('crs_req'); parentRef = find(rs,'Type','Reference','Index','3')
parentRef = Reference with properties: Id: 'Functional Requirements' CustomId: 'Functional Requirements' Artifact: 'crs_req.docx' ArtifactId: '?Functional Requirements' Domain: 'linktype_rmi_word' UpdatedOn: 02-Feb-2018 13:23:13 CreatedOn: NaT CreatedBy: '' ModifiedBy: '' IsLocked: 1 Summary: 'Functional Requirements' Description: '<div class=WordSection1>...' Rationale: '' Keywords: {} Type: 'Functional' IndexEnabled: 1 IndexNumber: [] SID: 9 FileRevision: 1 ModifiedOn: 03-Aug-2017 17:34:56 Dirty: 0 Comments: [0x0 struct] Index: '3'
查找修订版 1
中修改的所有 parentRef
子引用需求。
childRefs1 = find(parentRef,'FileRevision',1)
childRefs1=1×18 Reference array with properties:
Id
CustomId
Artifact
ArtifactId
Domain
UpdatedOn
CreatedOn
CreatedBy
ModifiedBy
IsLocked
Summary
Description
Rationale
Keywords
Type
IndexEnabled
IndexNumber
SID
FileRevision
ModifiedOn
Dirty
Comments
Index
查找在修订版 1
中修改且 SID 等于 12
的所有子引用需求parentRef
。
childRefs2 = find(parentRef,'FileRevision',1,'SID',12)
childRefs2 = Reference with properties: Id: 'Activating cruise control' CustomId: 'Activating cruise control' Artifact: 'crs_req.docx' ArtifactId: '?Activating cruise control' Domain: 'linktype_rmi_word' UpdatedOn: 02-Feb-2018 13:23:13 CreatedOn: NaT CreatedBy: '' ModifiedBy: '' IsLocked: 1 Summary: 'Activating cruise control' Description: '<div class=WordSection1>...' Rationale: '' Keywords: {} Type: 'Functional' IndexEnabled: 1 IndexNumber: [] SID: 12 FileRevision: 1 ModifiedOn: 03-Aug-2017 17:34:56 Dirty: 0 Comments: [0x0 struct] Index: '3.3'
清理
清除打开的需求集和链接集,并关闭打开的模型而不保存更改。
slreq.clear;
bdclose all;
版本历史记录
在 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)