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, 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.
Logical value specifying whether to ignore the coverage of descendant objects
Full path or handle to a lookup table block or a model containing a lookup table block.
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:
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'; open_system(mdl) %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 MC/DC outcomes covered percent_cov = 100 * cov(1) / cov(2)
Use the Coverage Settings dialog box to collect lookup table coverage for a model:
Open the model.
In the Model Editor, select Analysis > Coverage > Settings.
On the Coverage tab, select Coverage for this model.
Under Coverage metrics, select Lookup Table.
On the Results and Reporting tabs, specify the output you need.
Click OK to close the Coverage Settings dialog box and save your changes.
Simulate the model and review the results.