Retrieve modified condition/decision coverage information
coverage = mcdcinfo(cvdo, object)
coverage = mcdcinfo(cvdo, object, ignore_descendants)
[coverage, description] = mcdcinfo(cvdo, object)
Logical value specifying whether to ignore the coverage of descendant objects
A structure array containing the following fields:
Collect MCDC coverage for the
and determine the percentage of MCDC coverage collected for the Logic
block in the Gain subsystem:
mdl = 'slvnvdemo_cv_small_controller'; open_system(mdl) %Create test specification object testObj = cvtest(mdl) %Enable MCDC coverage testObj.settings.mcdc = 1; %Simulate model data = cvsim(testObj) %Retrieve MCDC results for Logic block blk_handle = get_param([mdl, '/Gain/Logic'], 'Handle'); cov = mcdcinfo(data, blk_handle) %Percentage of MCDC outcomes covered percent_cov = 100 * cov(1) / cov(2)
Use the Coverage Settings dialog box to collect MCDC coverage for a model:
Open the model.
In the Model Editor, select Analysis > Coverage > Settings.
On the Coverage tab, select Coverage for this model.
Under Coverage metrics, select MCDC.
On the Results and Reporting tabs, specify the output you need.
Click OK to close the Coverage Settings dialog box and save your changes.
Simulate the model and review the MCDC coverage results.