User`s guide

18 Coverage Collection During Simulation
18-20
Model Coverage for MATLAB Functions
In this section...
“About Model Coverage for MATLAB Functions” on page 18-20
“Types of Model Coverage for MATLAB Functions” on page 18-20
“How to Collect Coverage for MATLAB Functions” on page 18-22
“Examples: Model Coverage for MATLAB Functions” on page 18-23
About Model Coverage for MATLAB Functions
The Simulink Verification and Validation software simulates a Simulink model and
reports model coverage data for the decisions and conditions of code in MATLAB
Function blocks. Model coverage only supports coverage for MATLAB functions
configured for code generation.
For example, consider the following if statement:
if (x > 0 || y > 0)
reset = 1;
The if statement contains a decision with two conditions (x > 0 and y > 0). The
Simulink Verification and Validation software verifies that all decisions and conditions
are taken during the simulation of the model.
Types of Model Coverage for MATLAB Functions
The types of model coverage that the Simulink Verification and Validation software
records for MATLAB functions configured for code generation are:
“Decision Coverage” on page 18-20
“Condition and MCDC Coverage” on page 18-21
“Simulink Design Verifier Coverage” on page 18-21
“Relational Boundary Coverage” on page 18-22
Decision Coverage
During simulation, the following MATLAB Function block statements are tested for
decision coverage: