Main Content

deleteAllMetrics

R2026b

Delete all metric results

Since R2026b

    Description

    deleteAllMetrics(metricEngine) deletes all metric results for the project associated with the specified metricEngine object. The function also removes the associated information from the digital thread. To delete results for specific metrics instead of all metrics, use deleteMetrics.

    example

    Examples

    collapse all

    Delete all collected metric results from a project by using the deleteAllMetrics function.

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

    openExample("slcheck/ExploreTestingMetricDataInModelTestingDashboardExample");
    openProject("cc_CruiseControl");

    Create a metric.Engine object for collecting metric results.

    metricEngine = metric.Engine();
    

    Collect metric results.

    res = execute(metricEngine,["slcomp.ComponentStructure","modeldesign.TraceabilityAnalysis[slcomp.Links]"])
    res = 
    
      1×9 Result array with properties:
    
        UserData
        Value
        MetricID
        Artifacts
        ScopeId
        ScopeAlias
        ThresholdOutcomes
        Diagnostics

    Delete all metric results from the project.

    deleteAllMetrics(metricEngine)

    If you get the metric results again, the result is empty because deleteAllMetrics removed all results.

    res = getMetrics(metricEngine,["slcomp.ComponentStructure","modeldesign.TraceabilityAnalysis[slcomp.Links]"])
    res = 
    
      0x0 empty Result array with properties:
    
        UserData
        Value
        MetricID
        Artifacts
        ScopeId
        ScopeAlias
        ThresholdOutcomes
        Diagnostics

    Input Arguments

    collapse all

    Metric engine, specified as a metric.Engine object.

    Version History

    Introduced in R2026b