MATLAB 帮助中心
本页采用了机器翻译。点击此处可查看英文原文。
(待移除)移除度量阈值分类
以后的版本中将会删除度量仪表板用户界面、metricdashboard 函数、slmetric 包 API 以及相应的自定义项。有关详细信息,请参阅从度量盘迁移到模型可维护性仪表盘。
metricdashboard
slmetric
removeClassification(T,C1)
removeClassification(T,C1) 从 slmetric.config.Threshold 对象 T 中删除 slmetric.config.Classification 对象 C1。
T
C1
slmetric.config.Threshold
slmetric.config.Classification
示例
全部折叠
向 slmetric.config.Threshold 对象添加分类信息。然后,使用 getClassifications 函数识别属于阈值对象的 slmetric.config.Classification 对象。使用 removeClassification 函数从阈值对象中移除分类对象。
getClassifications
removeClassification
创建一个 slmetric.config.Configuration 对象,并获取默认的 slmetric.config.ThresholdConfiguration 对象。
slmetric.config.Configuration
slmetric.config.ThresholdConfiguration
CONF = slmetric.config.Configuration.new('name', 'Config'); TC = getThresholdConfigurations(CONF);
创建 slmetric.config.Threshold 对象并将其添加到 slmetric.config.ThresholdConfiguration 对象中。此阈值用于 slmetric.metric.Results 对象的 mathworks.metrics.SimulinkBlockCount 度量和 Value 属性。
slmetric.metric.Results
mathworks.metrics.SimulinkBlockCount
Value
T = addThreshold(TC, 'mathworks.metrics.SimulinkBlockCount', 'Value');
使用阈值对象 T 上的函数 getClassifications 获取定义合规类别的默认分类对象。使用分类对象范围内的 slmetric.metric.MetricRange 函数指定符合类别的度量值。
slmetric.metric.MetricRange
C = getClassifications(T); C.Range.Start = 5; C.Range.IncludeStart = 0; C.Range.End = 100; C.Range.IncludeEnd = 0;
指定 Warning 度量范围的值。
Warning
C = addClassification(T,'Warning'); C.Range.Start = -inf; C.Range.IncludeStart = 0; C.Range.End = 5; C.Range.IncludeEnd = 1;
指定 NonCompliant 度量范围的值。
NonCompliant
C = addClassification(T,'NonCompliant'); C.Range.Start = 100; C.Range.IncludeStart = 1; C.Range.End = inf; C.Range.IncludeEnd = 0;
现在,slmetric.config.Threshold 对象、T 对象包含三个 slmetric.config.Classification 对象。每一项都对应合规、不合规和警告这三个类别之一。
P = getClassifications(T)
P = 1×3 Classification array with properties: Category Range
查看 Category 属性的内容。
Category
P.Category
P.Category ans = 'Warning' ans = 'Compliant' ans = 'NonCompliant'
使用 removeClassification 函数从 slmetric.config.Threshold 对象中删除警告类别。
removeClassification(T,P(1))
阈值对象,指定为 slmetric.config.Threshold 对象。
要移除的分类对象,指定为 slmetric.config.Classification 对象。
slmetric.config.Threshold | slmetric.config.getActiveConfiguration | slmetric.config.setActiveConfiguration
slmetric.config.getActiveConfiguration
slmetric.config.setActiveConfiguration
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处