Main Content

Collect Coverage for Code

Measure coverage for code in model elements or generated from models

Simulink® Coverage™ measures code coverage and indicates the untested elements of your design. You can collect coverage for the C/C++ code in supported model elements, MATLAB® Function blocks, or the code generated from models in software-in-the-loop (SIL) mode or processor-in-the-loop (PIL) mode. Simulink Coverage measures several types of code coverage analysis, such as statement, condition, decision, and modified condition/decision coverage.


slcovmexBuild coverage-compatible MEX-function from C/C++ code
cvtestCreate model coverage test specification object
cvsimSimulate and return model coverage results for test objects


Code Coverage Basics

Coverage for MATLAB Code Used in Simulink

Coverage for Integrated C/C++ Code

Coverage for Generated Code