Retrieve lookup table coverage information from
coverage = tableinfo(cvdo, object)
coverage = tableinfo(cvdo, object, ignore_descendants)
[coverage, exeCounts] = tableinfo(cvdo, object)
[coverage, exeCounts, brkEquality] = tableinfo(cvdo, object)
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
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
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 to collect lookup table coverage for a model:
Open the model.
In the Model Editor, select Analysis > Coverage > Settings.
On the Coverage pane of the Configuration Parameters dialog box, select Enable coverage analysis.
Under Coverage metrics, select Lookup Table.
On the Coverage > Results pane, specify the output you need.
Click OK to close the Configuration Parameters dialog box and save your changes.
Simulate the model and review the results.