Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

find

クラス: slreq.ReqSet
名前空間: slreq

属性の値が一致する要件セットの要件を検索

構文

myReq = find(rs, 'PropertyName', 'PropertyValue')

説明

myReq = find(rs, 'PropertyName', 'PropertyValue') は、PropertyNamePropertyValue で指定されたプロパティと一致する要件セット rsslreq.Requirement オブジェクト myReq を検索して返します。プロパティ名の一致の判定では大文字小文字が区別されます。

入力引数

すべて展開する

要件セット。slreq.ReqSet オブジェクトとして指定します。

出力引数

すべて展開する

要件。slreq.Requirement オブジェクトとして返されます。

属性の値が一致する要件の検索

% 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 で導入