Main Content


Retrieve lookup table coverage information from cvdata object


coverage = tableinfo(cvdo, object)
coverage = tableinfo(cvdo, object, ignore_descendants)
[coverage, exeCounts] = tableinfo(cvdo, object)
[coverage, exeCounts, brkEquality] = tableinfo(cvdo, object)


coverage = tableinfo(cvdo, object) returns lookup table coverage results from the cvdata object cvdo for the model component object.

coverage = tableinfo(cvdo, object, ignore_descendants) returns lookup table coverage results for object, depending on the value of ignore_descendants.

[coverage, exeCounts] = tableinfo(cvdo, object) returns lookup table coverage results and the execution count for each interpolation/extrapolation interval in the lookup table block object.

[coverage, exeCounts, brkEquality] = tableinfo(cvdo, object) returns lookup table coverage results, the execution count for each interpolation/extrapolation interval, and the execution counts for breakpoint equality.

Input Arguments


cvdata object


Logical value specifying whether to ignore the coverage of descendant objects

1 — Ignore coverage of descendant objects
0 — Collect coverage for descendant objects


Full path or handle to a lookup table block or a model containing a lookup table block.

Output Arguments


A cell array containing vectors that identify the number of times during simulation that the lookup table block input was equivalent to a breakpoint value. Each vector represents the breakpoints along a different lookup table dimension.


The value of coverage is a two-element vector of form [covered_intervals total_intervals], the elements of which are:

covered_intervalsNumber of interpolation/extrapolation intervals satisfied for object
total_intervalsTotal number of interpolation/extrapolation intervals for object

coverage is empty if cvdo does not contain lookup table coverage results for object.


An array having the same dimensionality as the lookup table block; its size has been extended to allow for the lookup table extrapolation intervals.


Collect lookup table coverage for the slvnvdemo_cv_small_controller model and determine the percentage of interpolation/extrapolation intervals coverage collected for the Gain Table block in the Gain subsystem:

mdl = 'slvnvdemo_cv_small_controller';
%Create test spec object
testObj = cvtest(mdl)
%Enable lookup table coverage
testObj.settings.tableExec = 1;
%Simulate the model
data = cvsim(testObj)
blk_handle = get_param([mdl, '/Gain/Gain Table'], 'Handle');
%Retrieve l/u table coverage
cov = tableinfo(data, blk_handle)
%Percent MCDC outcomes covered
percent_cov = 100 * cov(1) / cov(2)


Use the coverage settings to collect lookup table coverage for a model:

  1. Open the model.

  2. In the Model Editor, select Model Settings on the Modeling tab.

  3. On the Coverage pane of the Configuration Parameters dialog box, select Enable coverage analysis.

  4. Under Coverage metrics, select Lookup Table.

  5. Click OK to close the Configuration Parameters dialog box and save your changes.

  6. Simulate the model by clicking the Run button and review the results.

Introduced in R2006b