Produce HTML report from model coverage objects


cvhtml(file, cvdo)
cvhtml(file, cvdo1, cvdo2, ...)
cvhtml(file, cvdo1, cvdo2, ..., options)
cvhtml(file, cvdo1, cvdo2, ..., options, detail)


cvhtml(file, cvdo) creates an HTML report of the coverage results in the cvdata or cv.cvdatagroup object cvdo when you run model coverage in simulation. cvhtml saves the coverage results in file. The model must be open when you use cvhtml to generate its coverage report.

cvhtml(file, cvdo1, cvdo2, ...) creates a combined report of several cvdata objects. The results from each object appear in a separate column of the HTML report. Each cvdata object must correspond to the same root model or subsystem. Otherwise, the function fails.

cvhtml(file, cvdo1, cvdo2, ..., options) creates a combined report of several cvdata objects using the report options specified by options.

cvhtml(file, cvdo1, cvdo2, ..., options, detail) creates a combined coverage report for several cvdata objects and specifies the detail level of the report with the value of detail.

Input Arguments


A cv.cvdatagroup object


Specifies the level of detail in the report. Set detail to an integer from 0 to 3. Greater numbers for detail indicate greater detail.

Default: 2


String specifying the HTML file in the MATLAB® current folder where cvhtml stores the results

Default: []


Specify the report options that you specify in options:

  • To enable an option, set it to 1 (e.g., '-hTR=1').

  • To disable an option, set it to 0 (e.g., '-bRG=0').

  • To specify multiple report options, list individual options in a single options string separated by commas or spaces (e.g., '-hTR=1 -bRG=0 -scm=0').

The following table lists all the options:



Show report



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



Do not report fully covered model objects



Include cyclomatic complexity numbers in summary



Include cyclomatic complexity numbers in block details



Filter Stateflow® events from report



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 ratelim_coverage.html:

model = 'slvnvdemo_cv_small_controller'; 
cvt = cvtest(model);
cvd = cvsim(cvt); 
outfile = 'ratelim_coverage.html';
cvhtml(outfile, cvd);


Use the Coverage Settings dialog box to create a model coverage report in an HTML file:

  1. Open the model for which you want a model coverage report.

  2. In the Simulink® Editor, select Analysis > Coverage > Settings.

  3. On the Coverage tab, select Coverage for this model.

  4. On the Report tab, select Generate HTML report.

  5. Click OK to close the Coverage Settings dialog box and save your changes.

  6. Simulate the model and review the generated report.

Was this topic helpful?