sigrangeinfo - Retrieve signal range coverage

                                              information from cvdata
                                              object - MATLAB ([original](https://in.mathworks.com/help/slcoverage/ref/sigrangeinfo.html)) ([raw](?raw))

Retrieve signal range coverage information from cvdata object

Syntax

Description

[[min](#brxo35g-1-min),[max](#brxo35g-1-max)] = sigrangeinfo([cvdo](#brxo35g-1%5Fsep%5Fbrxo2jj-1-cvdo),[modelObject](#brxo35g-1%5Fsep%5Fbtrlw80-object)) returns the minimum and maximum signal values output by the model componentmodelObject within thecvdata objectcvdo.

If a signal is variable size,min and max are vectors that contain the minimum and maximum values for each array position. If the array has an unbounded dimension, min andmax are single values that represent the minimum and maximum values across all array positions.

[[min](#brxo35g-1-min),[max](#brxo35g-1-max)] = sigrangeinfo([cvdo](#brxo35g-1%5Fsep%5Fbrxo2jj-1-cvdo),[modelObject](#brxo35g-1%5Fsep%5Fbtrlw80-object),[portID](#brxo35g-1-portID)) returns the minimum and maximum signal values associated with the output portportID ofmodelObject.

example

Examples

collapse all

This example shows how to extract signal range info from a coverage data object.

Load the model and set up coverage options

Load the model into memory. This example uses a small controller model.

modelName = 'slvnvdemo_cv_small_controller'; load_system(modelName)

Declare coverage settings using a structure of parameter names and values.

covOpts.CovEnable = 'on'; covOpts.CovSaveSingleToWorkspaceVar = 'on'; covOpts.CovSaveName = 'covData'; covOpts.CovMetricSignalRange = 'on';

Simulate the model using sim with the model name and the parameter structure as inputs.

simOut = sim(modelName,covOpts);

Get signal range data

Get the block handle of the Product block using get_param.

bHandle = get_param([modelName,'/Product'],'Handle');

Get the signal range data by calling sigrangeinfo with the cvdata object and the block handle as inputs.

[minVal, maxVal] = sigrangeinfo(covData,bHandle)

minVal =

 0

maxVal =

25.0000

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 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

collapse all

Minimum signal value output by the model object, returned as a scalar double. IfmodelObject output is a vector,min is a vector that contains the minimum signal value for each output. IfmodleObject output is an unbounded variable-size array, min is a single aggregated value that represents the maximum across all array positions.

If a block is not executed,sigrangeinfo returns+Inf for the min value of that block.

If a block is not a leaf block, sigrangeinfo returns an empty array.

Data Types: double

Maximum signal value output by the model object, returned as a scalar double. IfmodelObject output is a vector,max is a vector that contains the maximum signal value for each output. IfmodleObject output is an unbounded variable-size array, max is a single aggregated value that represents the maximum across all array positions.

If a block is not executed,sigrangeinfo returns-Inf for the max value of that block.

If a block is not a leaf block, sigrangeinfo returns an empty array.

Data Types: double

Alternatives

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

  1. Open the model for which you want to collect signal range coverage.
  2. In the Model Editor, select Model Settings on theModeling tab.
  3. On the Coverage pane of the Configuration Parameters dialog box, selectEnable coverage analysis.
  4. Under , select Signal Range.
  5. Click OK to close the Configuration Parameters dialog box and save your changes.
  6. Simulate the model by clicking theRun button and review the results.

Version History

Introduced in R2006b

expand all

If a block output is variable size and has an unbounded dimension, the min andmax output arguments are single values that represent the minimum and maximum values across all array positions.