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'