Main Content

tableinfo

Retrieve lookup table coverage information from cvdata object

Description

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

covInfo = tableinfo(cvdo,modelObject,ignoreDescendants) returns lookup table coverage results for modelObject, depending on the value of ignoreDescendants.

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

example

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

Examples

collapse all

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 MCDC outcomes covered
percent_cov = 100 * cov(1) / cov(2)

Input Arguments

collapse all

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 SpecificationDescription

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

To specify an S-Function block or its contents, use one of these formats:

Object SpecificationDescription

{BlockPath, fName}

Cell array with the path to an S-Function block and the name of a source file

{BlockHandle, fName}

Cell array with an S-Function block handle and the name of a source file

{BlockPath, fName, funName}

Cell array with the path to an S-Function block, the name of a source file, and a function name

{BlockHandle, fName, funName}

Cell array with an S-Function block handle, the name of a source file, and a function name

To specify a code coverage result, such as coverage data collected during software-in-the-loop (SIL) or processor-in-the-loop (PIL) analysis, use one of these formats:

Object SpecificationDescription

{fileName, funName}

Cell array with the name of a source file and a function name

{Model, fileName}

Cell array with a model name or model handle and the name of a source file

{Model, fileName, funName}

Cell array with a model name or model handle, the name of a source file, and a function name

Data Types: char | string | cell | Stateflow.State | Stateflow.Transition

Whether to ignore descendants in coverage results, specified as a numeric or logical 1 (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

collapse all

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_intervalsNumber of interpolation/extrapolation intervals satisfied for modelObject
total_intervalsTotal number of interpolation/extrapolation intervals for modelObject

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:

  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.

Version History

Introduced in R2006b