tableinfo - Retrieve lookup table coverage
information from cvdata
object - MATLAB ([original](https://in.mathworks.com/help/slcoverage/ref/tableinfo.html)) ([raw](?raw))
Retrieve lookup table coverage information from cvdata
object
Syntax
Description
[covInfo](#brxo36q-1-coverage) = tableinfo([cvdo](#brxo36q-1%5Fsep%5Fbrxo2jj-1-cvdo),[modelObject](#brxo36q-1%5Fsep%5Fbtrlw80-object))
returns lookup table coverage results from thecvdata
objectcvdo
for the model componentmodelObject
.
[covInfo](#brxo36q-1-coverage) = tableinfo([cvdo](#brxo36q-1%5Fsep%5Fbrxo2jj-1-cvdo),[modelObject](#brxo36q-1%5Fsep%5Fbtrlw80-object),[ignoreDescendants](#brxo36q-1%5Fsep%5Fmw%5Ffeb2a172-08b8-4e3b-b2bb-6c8d51d75f21))
returns lookup table coverage results for modelObject
, depending on the value of ignoreDescendants
.
[[covInfo](#brxo36q-1-coverage),[exeCounts](#brxo36q-1-exeCounts)] = tableinfo([cvdo](#brxo36q-1%5Fsep%5Fbrxo2jj-1-cvdo),[modelObject](#brxo36q-1%5Fsep%5Fbtrlw80-object))
returns lookup table coverage results and the execution count for each interpolation/extrapolation interval in the lookup table blockmodelObject
.
[[covInfo](#brxo36q-1-coverage),[exeCounts](#brxo36q-1-exeCounts),[brkEquality](#brxo36q-1-brkEquality)] = tableinfo([cvdo](#brxo36q-1%5Fsep%5Fbrxo2jj-1-cvdo),[modelObject](#brxo36q-1%5Fsep%5Fbtrlw80-object))
returns lookup table coverage results, the execution count for each interpolation/extrapolation interval, and the execution counts for breakpoint equality.
Examples
Collect lookup table coverage for theslvnvdemo_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 MCDC outcomes covered percent_cov = 100 * cov(1) / cov(2)
Input Arguments
Coverage data, specified as a cvdata
object.
Data Types: cvdata
Model object, specified as a character array, string array, Simulink® handle, Stateflow® ID, or cell array.
To specify a model object, such as a block or a Stateflow chart, use one of these formats:
Object Specification | Description |
---|---|
BlockPath | Full path to a model or block |
BlockHandle | Handle to a model or block |
slObj | Handle to a Simulink API object |
sfID | Stateflow ID |
sfObj | Handle to a Stateflow API object from a singly instantiated Stateflow chart |
{BlockPath,sfID} | Cell array with the path to a Stateflow chart or atomic subchart and the ID of an object contained in that chart or subchart |
{BlockPath,sfObj} | Cell array with the path to a Stateflow chart or subchart and a Stateflow object API handle contained in that chart or subchart |
{BlockHandle,sfID} | Cell array with a handle to a Stateflow chart or atomic subchart and the ID of an object contained in that chart or subchart |
Whether to ignore descendants in coverage results, specified as a numeric or logical1 (true)
or 0 (false)
, where:
0 (false)
includes coverage results of descendant objects.1 (true)
ignores coverage results of descendant objects.
Data Types: single
| double
| logical
Output Arguments
Coverage information, returned as a two-element array of the form[covered_intervals,total_intervals]
if cvdo contains lookup table coverage data, or an empty array if it does not.
covered_intervals | Number of interpolation/extrapolation intervals satisfied formodelObject |
---|---|
total_intervals | Total number of interpolation/extrapolation intervals formodelObject |
Data Types: double
Execution count, returned as an array of doubles. exeCounts
contains execution counts for each interpolation and extrapolation interval in the lookup table block.exeCounts
has one more entry in each dimension than the lookup table block.
Data Types: double
Breakpoint equality flag, returned as a cell array. Each cell contains a vector which identifies the number of times during simulation the lookup table block input is equivalent to a breakpoint value. Each vector represents the breakpoints along a different lookup table dimension.
Data Types: cell
Alternatives
Use the coverage settings to collect lookup table coverage for a model:
- Open the model.
- In the Model Editor, select Model Settings on theModeling tab.
- On the Coverage pane of the Configuration Parameters dialog box, selectEnable coverage analysis.
- Under Coverage metrics, select Lookup Table.
- Click OK to close the Configuration Parameters dialog box and save your changes.
- Simulate the model by clicking theRun button and review the results.
Version History
Introduced in R2006b