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...
Prashant Kumar answered .
2025-11-20
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);