find
类: slreq.ReqSet
命名空间: slreq
在需求集查找具有匹配属性值的需求
语法
myReq = find(rs, 'PropertyName', 'PropertyValue')
说明
在与 myReq
= find(rs
, 'PropertyName'
, 'PropertyValue'
)PropertyName
和 PropertyValue
匹配的属性指定的需求集rs
中查找并返回 slreq.Requirement
对象 myReq
。属性名称匹配不区分大小写。
输入参数
输出参量
示例
查找具有匹配属性值的需求
% Load a requirement set file rs = slreq.load('C:\MATLAB\My_Requirements_Set_1.slreqx'); % Find all editable requirements in the requirement set allReqs = find(rs, 'Type', 'Requirement'); % Find all referenced requirements in the requirement set allRefs = find(rs, 'Type', 'Reference'); % Find all requirements with a certain ID matchedReqs = find(rs, 'ID', 'R1.1');
使用正则表达式匹配查找需求
您可以使用波浪号 (~) 符号构建正则表达式搜索模式来搜索需求集的需求。
% Load a requirement set file rs = slreq.load('C:\MATLAB\My_Requirements_Set_1.slreqx'); % Find all requirements that correspond to the controller controllerReqs = find(rs, 'Type', 'Requirement', 'Summary', '~Controller(?i)\w*') controllerReqs = 1×19 Requirement array with properties: Id Summary Keywords Description Rationale SID CreatedBy CreatedOn ModifiedBy ModifiedOn FileRevision Dirty Comments
版本历史记录
在 R2018a 中推出