Question
Hi, After I use MATLAB 17b to generate harness model by using 'sldvmakeharness' function, the harness model and its signal builder display successfully. Normally I will click the 'run all and produce coverage' button in signal builder to test All cases and produce a model coverage report. Rather than click button, can I produce the coverage report programmly? I've spend a lot of time to search commands for this but nothing I can found...
Expert Answer
Prashant Kumar
PhD Expert
Answered Aug 25, 2026
I recommend using sldvrun to generate tests with Design Verifier, then sldvruntest to run the tests and cvhtml to generate a report. An example workflow is included in the documentation for sldvruntest, which I've copied here:
open_system('sldvdemo_cruise_control');
opts = sldvoptions;
opts.Mode = 'TestGeneration';
opts.SaveHarnessModel = 'on';
opts.SaveReport = 'off';
[ status, files ] = sldvrun('sldvdemo_cruise_control', opts);
runOpts = sldvruntestopts;
runOpts.coverageEnabled = true;
[ outData,covData ] = sldvruntest('sldvdemo_cruise_control',...
files.DataFile,runOpts);
cvhtml('coverageReport',covData);
100% Run Guarantee
3-Hour Fast-Track Delivery
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Tested on MATLAB R2024b / R2026a
Turnitin 0% Plagiarism Report
Free 7-Day Revisions Guarantee
Have a different question? Ask here
Related model converage an... Questions & Solutions
Browse All →
Explore similar technical troubleshooting questions and verified MATLAB solutions:
Ready-to-Run MATLAB & Simulink Projects
Browse All Projects →