How can I use the command to realize the selection of coverage filter?

1 回表示 (過去 30 日間)
chenchen wang
chenchen wang 2019 年 12 月 9 日
コメント済み: chenchen wang 2019 年 12 月 16 日
hi guys,
I want to use the command to realize the selection of coverage filtering(shown in the screenshot below,for Stateflow event, state ect.)
Does anyone know what command to use?:)thx

採用された回答

galaxy
galaxy 2019 年 12 月 9 日
You can create new rule which exclude this block.
example:
modelName = 'Frame_Test_Sc';
open_system(modelName);
set_param(modelName,'CovMetricSettings','dcme','RecordCoverage','on');
% Select blocks with block type 'RelationalOperator' to add a filter rule for.
bl = slcoverage.BlockSelector(slcoverage.BlockSelectorType.BlockType,'RelationalOperator');
filt = slcoverage.Filter;
rule = slcoverage.FilterRule(bl,'Tested elsewhere',slcoverage.FilterMode.Exclude);
filt.addRule(rule);
filt.save('blfilter');
csim = cvsim(modelName);
csim.filter = 'blfilter';
cvhtml('cov',csim);
When you want to exclude specified block, you can do as:
id = Simulink.ID.getSID('Frame_Test_Sc/Test_env/Controller/controller_chart');
bl = slcoverage.BlockSelector(slcoverage.BlockSelectorType.BlockInstance,id);
  1 件のコメント
chenchen wang
chenchen wang 2019 年 12 月 16 日
but how can I get the ID for Stateflow event, state ect.?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeComplex Logic についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by