Collect Code Coverage Data

Measure coverage for code generated from a Simulink® model or code within a Simulink model to indicate untested elements of your design during simulation

Simulink Coverage™ measures code coverage to indicate untested elements of your design, such as logical conditions, unintended functionality, and switch positions during simulation.


slcovmexBuild coverage-compatible MEX-function from C/C++ code
cvtestCreate model coverage test specification object
cvsimSimulate and return model coverage results for test objects
cvhtmlProduce HTML report from model coverage objects
cvmodelviewDisplay model coverage results with model coloring
mcdcinfoRetrieve modified condition/decision coverage information from cvdata object


Specify Code Coverage Options

Set options for code coverage.

Code Coverage for Models in Software-in-the-Loop (SIL) Mode and Processor-in-the-Loop (PIL) Mode

Configure code coverage for SIL and PIL simulations and review results.

Types of Code Coverage

Perform several types of code coverage analysis for models in SIL mode, PIL mode, and for the code within supported S-Function and MATLAB® Function blocks.

Coverage for Models with Code Blocks and Simulink Blocks

Record coverage for models with a combination of code blocks and other Simulink blocks.

Coverage for C and C++ S-Functions

Analyze model coverage for C/C++ S-Functions.

Cumulative Coverage Data

Collect cumulative model coverage from successive simulation runs.

Create and Run Test Cases

Create and run test cases by using the model coverage MATLAB commands cvtest and cvsim.

Was this topic helpful?