This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

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
executioninfoRetrieve execution coverage information from cvdata object
conditioninfoRetrieve condition coverage information from cvdata object
decisioninfoRetrieve decision coverage information from cvdata object
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 Custom C/C++ Code in Simulink Models

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.

Featured Examples