Retrieve modified condition/decision coverage information
coverage = mcdcinfo(cvdo, object)
coverage = mcdcinfo(cvdo, object, mode)
coverage = mcdcinfo(cvdo, object, ignore_descendants)
[coverage, description] = mcdcinfo(cvdo, object)
modified condition/decision coverage (MCDC) results from the
coverage = mcdcinfo(
the model component specified by
object for the
Logical value specifying whether to ignore the coverage of descendant objects
When specifying an S-function block, valid values for
For coverage data collected during Software-in-the-Loop (SIL)
mode or Processor-in-the-Loop (PIL) simulation mode, valid values
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 to collect MCDC coverage for a model:
Open the model.
In the Model Editor, select Analysis > Coverage > Settings.
On the Coverage pane of the Configuration Parameters dialog box, select Enable coverage analysis.
Under Coverage metrics, select MCDC as the structural coverage level.
On the Coverage > Results pane, specify the output you need.
Click OK to close the Configuration Parameters dialog box and save your changes.
Simulate the model and review the MCDC coverage results.