Main Content


Class: slmetric.Engine
Package: slmetric

(To be removed) Get error log

slmetric.Engine.getErrorLog will be removed in a future release. For size, architecture, and complexity metrics, use the metric.Engine API and the model maintainability metrics instead. For more information, see metric.Engine and Collect Model Maintainability Metrics Programmatically.


Get a log of errors and warnings that occurred during metric data collection of a specified metric engine object. The log includes errors that occurred during the execution of metric algorithms, model compilation, and metric data validation.

Input Arguments

expand all

Constructed slmetric.Engine object.

Output Arguments

expand all

The metricLog string contains the errors and warnings from metric analysis and is formatted in HTML.


expand all

This example shows how to create a slmetric.Engine object, set the analysis root, generate metrics, and create and display the error log for the model sldemo_fuelsys.

% Create an slmetric.Engine object
metric_engine = slmetric.Engine();

% Specify model for metric analysis
setAnalysisRoot(metric_engine, 'Root', 'sldemo_fuelsys');

% Collect model metrics for only the analysis root
metricID = 'mathworks.metrics.SimulinkBlockCount';
execute(metric_engine, metricID);

metricLog = getErrorLog(metric_engine);

Version History

Introduced in R2017a

expand all