|
|
|
| R2012a Documentation → Simulink Verification and Validation | |
Learn more about Simulink Verification and Validation |
|
| Contents | Index |
| On this page… |
|---|
Overview of Model Coverage Highlighting Enabling Coverage Highlighting |
When you simulate a Simulink model, you can configure your model to provide visual results that allow you to see at a glance which objects recorded 100% coverage. After the simulation:
In the model window, model objects are highlighted in certain colors according to what coverage was recorded:
Light green indicates that an object received full coverage during testing.
Light red indicates that an object received incomplete coverage.
Gray indicates that an object was filtered from coverage.
Objects with no color highlighting received no coverage.
When you click a colored object, the Coverage Display Window provides details about the coverage recorded for that block. For subsystems and Stateflow charts, the Coverage Display Window lists the summary coverage for all objects in that subsystem or chart. For other blocks, the Coverage Display Window list specific details about the objects that did not receive 100% coverage.
The simulation highlights blocks that received the following types of model coverage:
To enable the model coverage colored diagram display:
In the Simulink window, from the Tools menu, select Coverage Settings.
Select Display coverage results using model coloring. This is the default setting.
After you have enabled the coverage coloring, simulate your model. In the model, you can see at a glance which objects received full, partial, or no coverage.
The following sections show examples of model objects that
In this example, the Switch block received 100% coverage, as indicated by the green highlighting and the information in the Coverage Display Window.


In this example, the control_logic Stateflow chart received the following coverage:
Decision: 25%
Condition: 21%
MCDC: 0%


Inside the control_logic subsystem, the Pressure substate was never fail.


In the next example, in the Multiport Switch block, the second and third data ports were never executed.


In this example, the fuel_rate_control subsystem is highlighted in gray because it was filtered out of coverage recording.

After simulating the model and recording coverage, by default, the Coverage Display Window is the top-most visible window. When you click an object that recorded coverage, the Coverage Display Window displays details of the coverage recorded during simulation.
In the Coverage Display Window, you can:
Configure the window so it is not always the top-most
visible window. Next to Always on top, click
and removing
the check.
Configure the window to display coverage information
when you click an object that recorded coverage. Click
and select Click.
Configure the window to display coverage information
when you hover your cursor on an object that recorded coverage. Click
and select Focus.
Close the window. Press Alt+F4.
Close the window and remove all highlighting on the model. Select View > Remove highlighting.
![]() | Creating and Running Test Cases | Model Coverage for Multiple Instances of a Referenced Model | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |