Retrieve execution coverage information from
coverage = executioninfo(cvdo, object)
coverage = executioninfo(cvdo, object, mode)
coverage = executioninfo(cvdo, object, ignore_descendants)
[coverage, description] = executioninfo(cvdo, object)
When specifying an S-function block, valid values for
For coverage data collected during Software-in-the-Loop (SIL)
mode or Processor-in-the-Loop (PIL) simulation mode, valid values
Specifies to ignore the coverage of descendant objects if
The value of
and create the test specification object
Enable execution coverage for
executioninfo to retrieve the execution coverage
results for the Saturation block and determine the percentage of execution
mdl = 'slvnvdemo_cv_small_controller'; open_system(mdl) testObj = cvtest(mdl) data = cvsim(testObj) blk_handle = get_param([mdl, '/Saturation'], 'Handle'); cov = executioninfo(data, blk_handle) percent_cov = 100 * cov(1) / cov(2)
Use the coverage settings to collect and display execution coverage results:
Open the model.
In the Model Editor, select Model Settings on the Modeling tab.
On the Coverage pane of the Configuration Parameters dialog box, select Enable coverage analysis.
Under Coverage metrics, select Block Execution as the structural coverage level.
Click OK to close the Configuration Parameters dialog box and save your changes.
Simulate the model by clicking the Run button and review the results.