Simulink Verification and Validation
This example shows how to use the dialog box for coverage settings to enable coverage for a Simulink® model and adjust the type of information that is reported.
|On this page…|
The sldemo_clutch model that ships with Simulink provides a good introduction to model coverage. This model contains several blocks that have intrinsic decisions, places where control flow can take more than one path.
Coverage settings are contained in a tabbed dialog that is opened by selecting "Coverage Settings..." from the Simulink Tools menu.
Coverage is enabled with the top checkbox on the dialog titled "Enable Coverage Reporting". Once this is enabled the other elements of the dialog become active.
The instrumentation path is the portion of the model where coverage is recorded. This field should either contain the path to a subsystem (relative to the model root), or a forward slash, /, to indicate coverage will be recorded for the whole model.
The Coverage Metrics group of checkboxes control the type of coverage information that is collected during simulation. Selecting all of the checkboxes produces the most coverage information.
The coverage settings must be applied before they take effect during a simulation.
Once coverage is enabled for a model the information is automatically recorded whenever a simulation is performed. At the end of a simulation the information is compiled into an HTML report and displayed within the built-in MATLAB® web browser.