| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink Verification and Validation |
| Contents | Index |
| Learn more about Simulink Verification and Validation |
coverage = mcdcinfo(cvdo, object)
coverage = mcdcinfo(cvdo, object, ignore_descendants)
[coverage, description] = mcdcinfo(cvdo, object)
coverage = mcdcinfo(cvdo, object) returns modified condition/decision coverage (MC/DC) results from the cvdata object cvdo for the model component specified by object.
coverage = mcdcinfo(cvdo, object, ignore_descendants) returns MC/DC results for object, depending on the value of ignore_descendants.
[coverage, description] = mcdcinfo(cvdo, object) returns MC/DC results and text descriptions of each condition/decision in object.
cvdo |
cvdata object | ||||||||||||||||||
ignore_descendants |
Logical value specifying whether to ignore the coverage of descendant objects
| ||||||||||||||||||
object |
The object argument specifies an object in the Simulink model or Stateflow diagram that receives decision coverage. Valid values for object include the following:
|
coverage |
Two-element vector of the form [covered_outcomes total_outcomes]. coverage is empty if cvdo does not contain modified condition/decision coverage results for object. The two elements are:
| ||||||||||
description |
A structure array containing the following fields:
|
Collect MC/DC coverage for the slvnvdemo_cv_small_controller model and determine the percentage of MC/DC coverage collected for the Logic block in the Gain subsystem:
mdl = 'slvnvdemo_cv_small_controller'; open_system(mdl) testObj = cvtest(mdl) %Create test specification object testObj.settings.mcdc = 1; %Enable MC/DC coverage data = cvsim(testObj) %Simulate model blk_handle = get_param([mdl, '/Gain/Logic'], 'Handle'); cov = mcdcinfo(data, blk_handle) %Retrieve MC/DC results for Logic block percent_cov = 100 * cov(1) / cov(2) %Percentage of MC/DC outcomes covered
To collect MC/DC coverage for a model:
Open the model.
In the Model Editor, select Tools > Coverage Settings.
On the Coverage tab, under Coverage Metrics, select MCDC Coverage.
On the Results and Report tabs, select the desired options.
Click OK to close the Coverage Settings dialog box.
Simulate the model and review the MC/DC coverage in the report.
conditioninfo | cvsim | decisioninfo | sigrangeinfo | tableinfo
![]() | getID (ModelAdvisor.Check) | ModelAdvisor.Action class | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |