Main Content

slmetric.metric.Metric Class

Namespace: slmetric.metric
Superclasses:

(To be removed) Abstract class for creating model metrics

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

Abstract base class for creating model metrics. To create a model metric, create a MATLAB® class that derives from the slmetric.metric.Metric class.

Properties

expand all

Compile mode for metric calculation. If your model metric requires model compilation, specify PostCompile. If your model metric does not require model compilation, specify None.

Example: 'PostCompile'

Data Types: char

Model components for which metric is calculated. The metric is calculated for all components that match the type.

Metric description.

Data Types: char

Unique metric identifier.

Data Types: char

Use this property to communicate changes in your metric algorithm to the metric engine.

Data Types: uint32

Specify a name for the custom metric algorithm.

Data Types: char

Specify a name for the value that the metric collects. When you view detailed results in the Metrics Dashboard, the ValueName is the column header for the collected value in the table and tree views.

Data Types: char

Specify a name for the aggregated value that the metric collects. To specify this property, set AggregationMode to None. When you view detailed results in the Metrics Dashboard, the AggregatedValueName is the column header for the collected aggregated value in the table and tree views.

Data Types: char

Specify the names of the measures collected by the metric. Set this property only if the metric algorithm writes measures to the result object that the algorithm returns. When you view detailed results in the Metrics Dashboard, the MeasuresNames are column headers for the collected measures in the table and tree views.

Data Types: char

Specify the names of the aggregated measures collected by the metric. Set this property only if the metric algorithm writes measures to the result object that the algorithm returns and AggregationMode is set to None. When you view detailed results in the Metrics Dashboard, the AggregatedMeasuresNames are column headers for the collected aggregated measures in the table and tree views.

Data Types: char

If true, results produced by the metric algorithm change only if the model or library source files change. If the source file and the metric Version have not changed, metric data is not regenerated. If false, each call to slmetric.Engine.execute collects new data for this metric and stores it in the metric repository.

Data Types: logical

Specify the operation to aggregate the slmetric.metric.Result object properties Value and Measure across the component hierarchy. The metric algorithm outputs the aggregated values in the slmetric.metric.Result object properties AggregatedValues and AggregatedMeasures. Options are:

  • Sum: Returns the sum of the Value property and the Value properties of all its children components across the component hierarchy.

  • Max: Returns the maximum of the Value property and the Value properties of all its children components across the component hierarchy.

  • None: No aggregation of metric values.

Data Types: char

Specify whether the slmetric.metric.Result object property Details contains data. The default value is false. Metrics Dashboard filters are enabled when you set the value of this property to false.

Data Types: logical

Methods

algorithm(To be removed) Specify logic for metric data analysis

Version History

Introduced in R2016a

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.