DocumentationHelp CenterDocumentation
Class: slcoverage.Filter Package: slcoverage
Remove rule from filter rule set
result = removeRule(filter,rule)
result = removeRule(filter,rule) removes the filter rule from the specified filter.
result
filter
rule
expand all
slcoverage.Filter
Filter object to remove the rule from, specified as an slcoverage.Filter object.
slcoverage.FilterRule
Rule to remove from the filter, specified as an slcoverage.FilterRule object.
Rule removal result, returned as 0 or 1.
Create a block selector, a filter, and a rule for the selector. Add rules to the filter. Then, remove a rule from a filter.
Open the model. Specify coverage settings and turn on coverage recording.
modelName = 'sldemo_lct_bus'; open_system(modelName); set_param(modelName,'CovMetricStructuralLevel','MCDC','RecordCoverage','on');
Create two BlockSelector objects, bl and bl1.
BlockSelector
bl
bl1
bl = slcoverage.BlockSelector(slcoverage.BlockSelectorType.BlockType,'RelationalOperator'); id = Simulink.ID.getSID('sldemo_lct_bus/slCounter/And'); bl1 = slcoverage.BlockSelector(slcoverage.BlockSelectorType.BlockInstance,id);
Create a filter object, create two rule objects, and add each rule to the filter object.
filt = slcoverage.Filter; rule = slcoverage.FilterRule(bl,'Tested elsewhere',slcoverage.FilterMode.Exclude); rule1 = slcoverage.FilterRule(bl1,'Value is never greater than 0'); filt.addRule(rule); filt.addRule(rule1);
Review the rules. Look the first rule in the array.
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'
Remove the first rule that you added. Then review the rules to see that the first rule that you added is removed.
filt.removeRule(rule); fi = filt.rules
fi = FilterRule with properties: Selector: [1×1 slcoverage.BlockSelector] Mode: Justify Rationale: 'Value is never greater than 0'
addRule | slcoverage.Filter | slcoverage.filter.rules | slcoverage.FilterRule
addRule
slcoverage.filter.rules
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
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:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office