Main Content

sigsizeinfo

Retrieve signal size coverage information from cvdata object

Description

[min,max,allocated] = sigsizeinfo(cvdo,modelObject) returns the minimum, maximum, and allocated signal sizes for the outputs of model component modelObject within the coverage data object cvdo, if modelObject supports variable size signals.

example

[min,max,allocated] = sigsizeinfo(cvdo,modelObject,portID) returns the minimum and maximum signal sizes associated with the output port portID of the model component modelObject.

Examples

collapse all

Collect signal size coverage data for the Switch block in the sldemo_varsize_basic model:

mdl = 'sldemo_varsize_basic';
open_system(mdl);
%Create test spec object
testObj = cvtest(mdl);
%Enable signal size coverage
testObj.settings.sigsize=1;
%Simulate the model
data = cvsim(testObj);
%Set the block handle
blk_handle = get_param([mdl, '/Switch'], 'Handle');
%Get signal size data
[minVal, maxVal, allocVal] = sigsizeinfo(data, blk_handle);

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, for example a block or a Stateflow chart, use one of the following 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 the following 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 an a function name

To specify a code coverage result, for example coverage data collected during software-in-the-loop (SIL) or processor-in-the-loop (PIL) analysis, use one of the following 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

Output port of the block, specified as a character array or a string array.

Data Types: char | string

Output Arguments

collapse all

Maximum signal value output by the model object, returned as a scalar. If modelObject output is a vector, max is also a vector.

Data Types: double

Minimum signal value output by the model object, returned as a scalar. If modelObject output is a vector, max is also a vector.

Data Types: double

Allocated signal size output by the model object, returned as a scalar. If modelObject has multiple outputs, max is a vector that contains the allocated signal size for each output.

Data Types: double

Alternatives

Use the coverage settings to collect signal size coverage for a model:

  1. Open the model for which you want to collect signal size coverage.

  2. In the Simulink 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 Signal Size.

  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 R2010b