User`s guide
Model Coverage for MATLAB Functions
18-33
• The MCDC coverage tables for decision lines 27 and 30 each list two cases of decision
reversal for each condition, for a total of four possible reversals. Only the decision
reversal for a change in the evaluation of the condition right1 < left2 of line 30
from true to false did not occur during simulation. This means that three of four, or
75% of the possible reversal cases were tested for during simulation, for a coverage of
75%.
Model Coverage for MATLAB Functions in an External File
Using the same model in “Model Coverage for MATLAB Function Blocks” on page
18-23, suppose the MATLAB functions run_intersect_test and rect_intersect
are stored in an external MATLAB file named run_intersect_test.m.
To collect coverage for MATLAB functions in an external file, on the Coverage Settings
dialog box, on the Coverage tab, select Coverage for MATLAB files.
After simulation, the model coverage report summary contains sections for the top-level
model and for the external function.
The model coverage report for run_intersect_test.m reports the same coverage data
as if the functions were stored in the MATLAB Function block.
For a detailed example of a model coverage report for a MATLAB function in an external
file, see “External MATLAB File Coverage Report” on page 19-5.
Model Coverage for Simulink Design Verifier MATLAB Functions
If the MATLAB code includes any of the following Simulink Design Verifier functions
configured for code generation, you can measure coverage: