addRule
Class: slcoverage.Filter
Namespace: slcoverage
Add coverage filtering rule to filter
Syntax
result = addRule(filter,rule)
Input Arguments
filter
— Filter object to add the rule to
slcoverage.Filter
object
Filter object to add the rule to, specified as an
slcoverage.Filter
object.
rule
— Rule to add to the filter
slcoverage.FilterRule
object
Rule to add to the filter, specified as an
slcoverage.FilterRule
object.
Output Arguments
result
— Rule addition result
logical
Rule addition result, returned as 0 or 1.
Examples
Add Rule to Filter Object
Create a block selector, a filter, and a rule for the selector. Then add the rule to the filter.
Open the model. Specify coverage settings and turn on coverage recording.
modelName = 'slcoverage_lct_bus'; openExample(modelName); open_system(modelName); set_param(modelName,'CovMetricStructuralLevel','MCDC','RecordCoverage','on');
Create a BlockSelector
object, bl
.
This block selector selects all blocks in
the model with the property 'RelationalOperator'
.
bl = slcoverage.BlockSelector(slcoverage.BlockSelectorType.BlockType,'RelationalOperator');
Create a filter object, create a rule object, and add the rule to the filter object.
filt = slcoverage.Filter;
rule = slcoverage.FilterRule(bl,'Tested elsewhere',slcoverage.FilterMode.Exclude);
filt.addRule(rule);
Version History
Introduced in R2017b
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)