Main Content

removeThreshold

Class: slmetric.config.ThresholdConfiguration
Package: slmetric.config

Remove threshold object from threshold configuration object

Description

Remove a threshold object from a threshold configuration object.

example

removeThreshold(TC,T) removes the slmetric.config.Threshold object T from the slmetric.config.ThresholdConfiguration object TC.

Input Arguments

expand all

slmetric.config.ThresholdConfiguration object from which you want to remove an slmetric.config.Threshold object.

Data Types: char

slmetric.config.Threshold object that you want to remove from an slmetric.config.ThresholdConfiguration object.

Data Types: char

Examples

expand all

Use the getThresholds method to identify the slmetric.config.Threshold objects that belong to an slmetric.config.ThresholdConfiguration object. Then, use the removeThreshold method to remove an slmetric.config.Threshold object.

For the slmetric.config.ThresholdConfiguration object TC, use the getThresholds method.

A = getThresholds(TC)
A = 

  1×2 Threshold array with properties:

    MetricID
    AppliesTo

The slmetric.config.ThresholdConfiguration object TC contains two slmetric.config.Threshold objects.

Identify the slmetric.config.Threshold object that you want to remove from the slmetric.config.ThresholdConfiguration object.

A.MetricID
ans =

    'mathworks.metrics.SimulinkBlockCount'


ans =

    'mathworks.metricchecks.SubSystemCount'

Remove the second element of the array that corresponds to the mathworks.metricchecks.SubSystemCount metric.

removeThreshold(TC,A(2))

The slmetric.ThresholdConfiguration object now contains one slmetric.config.Threshold object corresponding to the mathworks.metricchecks.SubSystemCount metric.

getThresholds(TC)
ans = 

  Threshold with properties:

     MetricID: 'mathworks.metrics.SimulinkBlockCount'
    AppliesTo: 'Value'
Introduced in R2018b