sigsizeinfo - Retrieve signal size coverage information from cvdata
object - MATLAB ([original](https://in.mathworks.com/help/slcoverage/ref/sigsizeinfo.html)) ([raw](?raw))
Retrieve signal size coverage information from cvdata
object
Syntax
Description
[[min](#bsj9ut%5F-1-min),[max](#bsj9ut%5F-1-max),[allocated](#bsj9ut%5F-1-allocated)] = sigsizeinfo([cvdo](#bsj9ut%5F-1%5Fsep%5Fbrxo2jj-1-cvdo),[modelObject](#bsj9ut%5F-1%5Fsep%5Fbtrlw80-object))
returns the minimum, maximum, and allocated signal sizes for the outputs of model component modelObject
within the coverage data objectcvdo
, if modelObject
supports variable size signals.
allocated
is the upper boundary of the signal size that Simulink® allocates memory for. The value of allocated
is the maximum value specified in the parameters for the model object, such as thePortDimensions
parameter of an Inport block. If the upper boundary for the signal size is inf
,sigsizeinfo
returns inf
, and the coverage report does not display a value in the Allocated column for that model object.
[[min](#bsj9ut%5F-1-min),[max](#bsj9ut%5F-1-max),[allocated](#bsj9ut%5F-1-allocated)] = sigsizeinfo([cvdo](#bsj9ut%5F-1%5Fsep%5Fbrxo2jj-1-cvdo),[modelObject](#bsj9ut%5F-1%5Fsep%5Fbtrlw80-object),[portID](#bsj9ut%5F-1-portID))
returns the minimum, maximum, and allocated signal sizes associated with the output port portID
of the model componentmodelObject
.
Examples
This example shows how to retrieve signal size coverage data from a simulation.
Load the model.
modelName = "slvnvdemo_varsize_basic"; load_system(modelName);
The model is already configured to collect coverage. Simulate the model using sim
.
simOut = sim(modelName); covData = simOut.covdata;
Extract the signal size information for the Switch block.
blockName = modelName + "/Switch"; [minVal, maxVal, allocatedVal] = sigsizeinfo(covdata,blockName)
minVal =
1
maxVal =
6
allocatedVal =
6
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 |
Output port of the block, specified as a character array or a string array.
Data Types: char
| string
Output Arguments
Maximum signal size that occurred during simulation for the model object, returned as a scalar double. If the modelObject output is a vector, max
is a vector that contains the maximum signal size for each output.
Data Types: double
Minimum signal size that occurred during simulation for the model object, returned as a scalar double. If the modelObject output is a vector, min
is a vector that contains the minimum signal size for each output.
Data Types: double
Allocated signal size output for the model object, returned as a double.allocated
is the upper limit set in the parameters of the model object. For example, if the value of the Inport block parameter PortDimensions
is 20
,allocated
returns 20
.
If the modelObject output is a vector,allocated
is a vector that contains the allocated signal size for each output. If modelObject
uses unbounded variable-size arrays, allocated
returnsinf
. For more information about unbounded variable-size arrays, see Customize Variable Sizes.
Data Types: double
Alternatives
Use the coverage settings to collect signal size coverage for a model:
- Open the model for which you want to collect signal size coverage.
- In the Simulink Editor, select Model Settings on theModeling tab.
- On the Coverage pane of the Configuration Parameters dialog box, select Enable coverage analysis.
- Under , select Signal Size.
- Click OK to close the Configuration Parameters dialog box and save your changes.
- Simulate the model by clicking the Run button and review the results.
Version History
Introduced in R2010b
When a variable-size array is unbounded, allocated
returnsinf
. A signal size is unbounded when you set the maximum signal size of one or more dimension to inf
.