Main Content


Return errors that occurred during artifact tracing

Since R2020b



errors = getArtifactErrors(metricEngine) returns the errors that occurred when the metric engine analyzed the artifacts. When you collect metric results by using the execute function, the engine object does not collect results for artifacts that return errors during analysis.

Note that there is also a function getArtifactErrors (Fixed-Point Designer) in the Fixed-Point Designer™ documentation.


collapse all

Collect metrics for the testing artifacts in a project. Then, check if artifacts returned errors and were not analyzed.

Open the project. For this example, in the MATLAB® Command Window, enter:


Create a metric.Engine object for the project.

metric_engine = metric.Engine();

Update the trace information for metric_engine to ensure that the artifact information is up to date.


Collect results for the metric 'RequirementsPerTestCase' by using the execute function on the metric.Engine object.


Access the errors that occurred during analysis.

ans = 

  0×0 empty struct array with fields:


For this example, the artifacts did not return errors.

Input Arguments

collapse all

Metric engine object that you want to check for errors, specified as a metric.Engine object.

Output Arguments

collapse all

Artifact errors that occurred when you executed the metric.Engine object, returned as an array of structures that correspond to the errors. The structure for an error contains these fields:

  • Address — Address of the artifact that returned the error

  • UUID — Unique identifier of the artifact

  • ErrorID — Identifier of the error

  • ErrorMessage — Description of the error

Alternative Functionality


To view artifact issues for a Model Design or Model Testing dashboard, click Artifact Issues in the dashboard toolstrip. The Artifact Issues tab shows a table of the artifact issues in the current project. You can click on the hyperlinks in the Source column to open the affected artifact. You can also sort the artifact issues by type by clicking the Message ID column header. For more information, see View Artifact Issues in Project.

Artifacts that generate errors appear in the Errors folder in the dashboard user interface. For more information, see Artifact Errors.

Version History

Introduced in R2020b