Main Content

addThreshold

Class: slmetric.config.ThresholdConfiguration
Namespace: slmetric.config

(To be removed) Create slmetric.config.Threshold object

The Metrics Dashboard user interface, metricdashboard function, slmetric package API, and corresponding customizations will be removed in a future release. For more information, see Migrating from Metrics Dashboard to Model Maintainability Dashboard.

Description

Create an slmetric.config.Threshold object to apply thresholds to the data for a specific metric.

TH = addThreshold(TC,metricid,thresholdproperty) creates an slmetric.config.Threshold object.

example

Input Arguments

expand all

slmetric.config.ThresholdConfiguration object for which you add an slmetric.config.Threshold object.

Data Types: char

Metric identifier for model metric or custom model metric that you create.

Example: 'mathworks.metrics.SimulinkBlockCount'

Data Types: char

slmetric.metric.Result property to which you apply thresholds. You can apply thresholds to the Value and AggregatedValue properties.

Output Arguments

expand all

slmetric.config.Threshold object for applying thresholds to either the Value or AggregatedValue properties of an slmetric.metric.Result object.

Examples

expand all

By default, an slmetric.config.Configuration object holds one slmetric.config.ThresholdConfiguration object. Use the getThresholdConfigurations method to add this object to the base workspace. Use the slmetric.config.addThreshold method to add slmetric.config.Threshold objects to this slmetric.config.ThresholdConfiguration object.

Create an slmetric.config.Configuration object.

CONF = slmetric.config.Configuration.new('name', 'Config');

Get the default slmetric.config.ThresholdConfiguration object in CONF.

TC = getThresholdConfigurations(CONF);

Add an slmetric.config.Threshold object to the slmetric.config.ThresholdConfiguration object TC. This threshold is for the mathworks.metrics.SubSystemCount metric and the Value property of the slmetric.metric.Results object.

E = addThreshold(TC,'mathworks.metrics.SubSystemCount','Value');

Use the slmetric.config.Classification and slmetric.config.MetricRange classes to specify threshold values corresponding to the mathworks.metrics.SubsystemCount metric.

Version History

Introduced in R2018b

collapse all

R2022a: Metrics Dashboard will be removed

The Metrics Dashboard user interface, metricdashboard function, slmetric package API, and corresponding customizations will be removed in a future release. For more information, see Migrating from Metrics Dashboard to Model Maintainability Dashboard.