Produce HTML report from model coverage objects
Make sure you have write access to the default MATLAB® folder. Create a cumulative coverage report for the
slvnvdemo_cv_small_controller mode and save it as
model = 'slvnvdemo_cv_small_controller'; open_system(model); cvt = cvtest(model); cvd = cvsim(cvt); outfile = 'ratelim_coverage.html'; cvhtml(outfile, cvd);
cvdo— Coverage data
Coverage data, specified as a
cvdata object or
file— HTML file name
HTML file name, specified as a character or string array. You can specify
the absolute path or relative path and the HTML file where
cvhtml stores the report.
options— Report options
Reporting options, specified as a character or string array.
To enable an option, set it to
To disable an option, set it to
To specify multiple report options, list individual
options in a single
options character vector or string separated
by commas or spaces (e.g.,
Web view mode
Include each test in the model summary
Produce bar graphs in the model summary
Use two color bar graphs (red, blue)
Display hit/count ratio in the model summary
Exclude execution metric details from report
Exclude fully covered model objects from report
Exclude fully covered model object details from report
Include cyclomatic complexity numbers in summary
Include cyclomatic complexity numbers in block details
Filter Stateflow® events from report
simMode— Simulation mode
Simulation mode, specified as a character or string array. Valid values include the following:
Model in Normal simulation mode.
Model in Software-in-the-Loop (SIL) or Processor-in-the-Loop (PIL) simulation mode.
Model reference in Software-in-the-Loop (SIL) or Processor-in-the-Loop (PIL) simulation mode.
Model reference in Software-in-the-Loop (SIL or Processor-in-the-Loop (PIL) simulation mode with code interface set to top model.
Use the coverage settings to create a model coverage report in an HTML file:
Open the model for which you want a model coverage report.
In the Simulink® Editor, select Model Settings on the Modeling tab.
On the Coverage pane of the Configuration Parameters dialog box, select Enable coverage analysis.
Click OK to close the Configuration Parameters dialog box and save your changes.
Simulate the model by clicking the Run button and review the generated report.