Run Simulation and Produce Coverage Report

Once you enable coverage data collection, coverage information is automatically recorded when you simulate the model. At the end of the simulation, the model coverage tool produces an HTML report of coverage information, which is displayed in the built-in MATLAB® web browser.

sim('sldemo_lct_bus', 'StopTime', '20');

Extract Information from Coverage Data Objects

The cvdata object can be used to extract coverage information for S-Functions, just like any other supported model element. For instance, the decisioninfo command extracts coverage information from a block path or a block handle. The output is a vector containing the satisfied and total outcomes for a single model object.