getClassifications
Obtain metric data classifications
Description
returns the classifications
= getClassifications(threshold
)slmetric.config.Classification
object or an array of
slmetric.config.Classification
objects that are in the threshold
object.
Examples
Remove Classification Object from Threshold Object
Add classification information to an
slmetric.config.Threshold
object. Then, use the
getClassifications
function to identify the
slmetric.config.Classification
objects that belong to the threshold object.
Use the removeClassification
function to remove an classification
object from the threshold object.
Create an slmetric.config.Configuration
object and get the
default slmetric.config.ThresholdConfiguration
object.
CONF = slmetric.config.Configuration.new('name', 'Config'); TC = getThresholdConfigurations(CONF);
Create an slmetric.config.Threshold
object and add it to the
slmetric.config.ThresholdConfiguration
object. This threshold is
for the mathworks.metrics.SimulinkBlockCount
metric and the
Value
property of the slmetric.metric.Results
object.
T = addThreshold(TC, 'mathworks.metrics.SimulinkBlockCount', 'Value');
Get the default classification object, which defines the compliant category, by
using the function getClassifications
on the threshold object
T
. Specify metric values for the compliant category by using the
slmetric.metric.MetricRange
functions on the range of the
classification object.
C = getClassifications(T); C.Range.Start = 5; C.Range.IncludeStart = 0; C.Range.End = 100; C.Range.IncludeEnd = 0;
Specify values for the Warning
metric range.
C = addClassification(T,'Warning');
C.Range.Start = -inf;
C.Range.IncludeStart = 0;
C.Range.End = 5;
C.Range.IncludeEnd = 1;
Specify values for the NonCompliant
metric range.
C = addClassification(T,'NonCompliant');
C.Range.Start = 100;
C.Range.IncludeStart = 1;
C.Range.End = inf;
C.Range.IncludeEnd = 0;
Now, the slmetric.config.Threshold
object, T
,
contains three slmetric.config.Classification
objects. Each one
corresponds to one of the categories compliant, noncompliant, and warning.
P = getClassifications(T)
P = 1×3 Classification array with properties: Category Range
Look at the contents of the Category
property.
P.Category
P.Category ans = 'Warning' ans = 'Compliant' ans = 'NonCompliant'
Use the removeClassification
function to remove the warning
category from the slmetric.config.Threshold
object.
removeClassification(T,P(1))
Input Arguments
threshold
— Metric data thresholds
slmetric.config.Threshold
object
Metric data thresholds, specified as an slmetric.config.Threshold
object.
Output Arguments
classifications
— Classification object
slmetric.config.Classification
object | array of slmetric.config.classification
objects
slmetric.config.Classification
object or array of
slmetric.config.Classification
objects that contain metric data
classifications.
Version History
Introduced in R2018b
MATLAB コマンド
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)