Main Content


Class: slcoverage.Filter
Package: slcoverage

Add coverage filtering rule to filter


result = addRule(filter,rule)


result = addRule(filter,rule) adds the filter rule to the specified filter.

Input Arguments

expand all

Filter object to add the rule to, specified as an slcoverage.Filter object.

Rule to add to the filter, specified as an slcoverage.FilterRule object.

Output Arguments

expand all

Rule addition result, returned as 0 or 1.


expand all

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 = 'sldemo_lct_bus';

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);
Introduced in R2017b