이 페이지는 기계 번역을 사용하여 번역되었습니다. 영어 원문을 보려면 여기를 클릭하십시오.
slmetric.metric.ResultCollection
(제거 예정) 지정된 모델 지표에 대한 지표 데이터
Metrics Dashboard 사용자 인터페이스, metricdashboard
기능, slmetric
패키지 API 및 해당 사용자 정의는 향후 릴리스에서 제거될 예정입니다. 자세한 내용은 Migrating from Metrics Dashboard to Model Maintainability Dashboard를 참조하세요.
설명
slmetric.metric.ResultCollection
개체에는 특정 모델 메트릭에 대한 메트릭 데이터가 포함되어 있습니다.
생성
slmetric.metric.ResultCollection
개체를 생성하려면 slmetric.Engine
개체에 getMetrics
을 사용합니다. getMetrics
는 메트릭 엔진이 실행한 모든 메트릭에 대한 결과 수집 개체의 배열을 반환합니다.
속성
MetricID
— 메트릭 식별자
문자형 벡터
MathWorks 지표 또는 사용자 지정 지표에 대한 지표 식별자로, 문자형 벡터로 지정됩니다. slmetric.metric.getAvailableMetrics
를 호출하여 메트릭 식별자를 얻을 수 있습니다.
예: 'mathworks.metrics.SimulinkBlockCount'
Status
— 메트릭 실행 상태
정수
읽기 전용 속성입니다.
지표 실행의 상태 코드로, 정수로 반환됩니다.
정수 | 상태 |
---|---|
1 | 결과가 없다. 메트릭 알고리즘은 분석된 시스템에 적용할 수 없습니다. 메트릭으로 분석된 구성 요소를 찾을 수 없거나 메트릭에 컴파일 요구 사항이 있어 라이브러리 모델에서 실행할 수 없습니다. |
0 | 결과가 수집되었습니다. |
-1 | 결과가 없다. 메트릭을 실행하는 중에 오류가 발생했습니다. |
-2 | 이전 실행에서 사용할 수 있는 결과가 없습니다. |
-3 | 결과가 없다. 컴파일 오류입니다. |
-4 | 결과가 비어 있습니다. 전제조건이 누락되었습니다. |
Category
— 임계값 기준에 따른 메트릭 데이터 카테고리
'Compliant'
| 'NonCompliant'
| 'Warning'
| 'Uncategorized'
읽기 전용 속성입니다.
메트릭 데이터 카테고리로, 다음 네 가지 카테고리 중 하나로 반환됩니다.
준수 — 허용 가능한 범위에 있는 지표 데이터입니다.
경고 — 검토가 필요한 지표 데이터입니다.
NonCompliant — 모델 수정이 필요한 지표 데이터입니다.
분류되지 않음 — 임계값이 없는 지표 데이터입니다.
하나 이상의 구성 요소가 NonCompliant
인 경우 이 속성은 NonCompliant
을 반환합니다. 하나 이상의 구성 요소가 Warning
이고 구성 요소가 NonCompliant
인 경우 이 속성은 Warning
을 반환합니다. 모든 구성 요소가 Compliant
인 경우 이 속성은 Compliant
을 반환합니다.
Outdated
— 메트릭 데이터가 최신인지 확인
logical
읽기 전용 속성입니다.
메트릭 데이터가 최신인지 여부는 true
또는 false
로 반환됩니다. true
인 경우 모델 또는 소스 파일이 변경되었기 때문에 메트릭 데이터가 오래된 것입니다.
Results
— 하나 이상의 지표를 실행하기 위해 수집된 지표 데이터
slmetric.metric.Result
객체 배열
읽기 전용 속성입니다.
하나 이상의 지표에 대해 execute
메서드를 호출할 때 수집된 지표 데이터로, slmetric.metric.Result
개체의 배열로 반환됩니다.
예제
하나의 지표에 대한 지표 데이터 수집 및 액세스
이 예에서는 sldemo_mdlref_basic
모델에 대한 지표 데이터를 수집하고 액세스하는 방법을 보여줍니다.
sldemo_mdlref_basic
모델을 엽니다.
open_system('sldemo_mdlref_basic');
slmetric.Engine
객체를 생성하고 분석을 위해 모델에 루트를 설정합니다.
metric_engine = slmetric.Engine(); % Include referenced models and libraries in the analysis, % these properties are on by default metric_engine.ModelReferencesSimulationMode = 'AllModes'; metric_engine.AnalyzeLibraries = 1; setAnalysisRoot(metric_engine, 'Root', 'sldemo_mdlref_basic')
모델 메트릭 데이터를 수집합니다.
execute(metric_engine, 'mathworks.metrics.ExplicitIOCount');
모델 메트릭 데이터를 slmetric.metric.ResultCollection
개체의 배열로 반환하고 이를 res_col
에 할당합니다.
res_col = getMetrics(metric_engine, 'mathworks.metrics.ExplicitIOCount');
mathworks.metrics.ExplicitIOCount
메트릭에 대한 결과를 표시합니다.
for n=1:length(res_col) if res_col(n).Status == 0 result = res_col(n).Results; for m=1:length(result) disp(['MetricID: ',result(m).MetricID]); disp([' ComponentPath: ',result(m).ComponentPath]); disp([' Value: ', num2str(result(m).Value)]); disp([' AggregatedValue: ', num2str(result(m).AggregatedValue)]); disp([' Measures: ', num2str(result(m).Measures)]); disp([' AggregatedMeasures: ', num2str(result(m).AggregatedMeasures)]); end else disp(['No results for:', result(n).MetricID]); end disp(' '); end
ComponentPath: sldemo_mdlref_basic
의 경우 출력이 3개이므로 값은 3
입니다. 세 개의 출력은 Measures
배열의 두 번째 요소에 있습니다. slmetric.metric.AggregationMode
은 Max
이므로 AggregatedValue
은 4
이며, 이는 sldemo_mdlref_counter
에 대한 입출력 개수입니다. AggregatedMeasures
배열에는 구성 요소 또는 하위 구성 요소에 대한 최대 입력 및 출력 수가 포함됩니다.
버전 내역
R2016a에 개발됨R2022a: Metrics Dashboard이 제거됩니다
Metrics Dashboard 사용자 인터페이스, metricdashboard
기능, slmetric
패키지 API 및 해당 사용자 정의는 향후 릴리스에서 제거될 예정입니다. 자세한 내용은 Migrating from Metrics Dashboard to Model Maintainability Dashboard를 참조하세요.
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 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)