rules
クラス: slcoverage.Filter
名前空間: slcoverage
フィルターの規則
構文
fr = rules(filter)
fr = rules(filter,element)
入力引数
filter
— 返す規則が含まれているフィルター オブジェクト
slcoverage.Filter
オブジェクト
返す規則が含まれているフィルター オブジェクト。slcoverage.Filter
オブジェクトとして指定します。
element
— 要素識別子
Simulink® ID | プロパティ | ハンドル
この プロパティ は読み取り専用です。
返す規則が含まれているモデル要素の識別子。Simulink ID、モデル要素プロパティ、またはハンドルの文字ベクトルまたは string として指定します。
出力引数
fr
— フィルター規則
slcoverage.FilterRule
オブジェクト | slcoverage.FilterRule
オブジェクトの配列
フィルター規則。slcoverage.FilterRule
オブジェクトまたは slcoverage.FilterRule
オブジェクトの配列として返されます。
例
フィルター オブジェクトのすべての規則の取得
モデルを開きます。カバレッジの設定を指定して、カバレッジの記録をオンにします。
modelName = 'slcoverage_lct_bus'; open_system(modelName); set_param(modelName,'CovMetricStructuralLevel','MCDC','RecordCoverage','on');
BlockSelector
オブジェクト、bl
を作成します。フィルター オブジェクトを作成し、規則を作成して、規則をフィルターに追加します。
bl = slcoverage.BlockSelector(slcoverage.BlockSelectorType.BlockType,'RelationalOperator'); filt = slcoverage.Filter; rule = slcoverage.FilterRule(bl,'Tested elsewhere',slcoverage.FilterMode.Exclude); filt.addRule(rule);
別の規則を作成してフィルター オブジェクトに追加します。
id = Simulink.ID.getSID('slcoverage_lct_bus/slCounter/And'); bl = slcoverage.BlockSelector(slcoverage.BlockSelectorType.BlockInstance,id); rule = slcoverage.FilterRule(bl,'Value is never greater than 0'); filt.addRule(rule);
rules
を使用してフィルター規則を返します。配列内の最初の規則を表示します。
fi = filt.rules fi(1)
fi = 1×2 FilterRule array with properties: Selector Mode Rationale ans = FilterRule with properties: Selector: [1×1 slcoverage.BlockSelector] Mode: Exclude Rationale: 'Tested elsewhere'
rules
を使用して And ブロックの規則のみを返します。
filt.rules(id)
ans = FilterRule with properties: Selector: [1×1 slcoverage.BlockSelector] Mode: Justify Rationale: 'Value is never greater than 0'
バージョン履歴
R2017b で導入
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)