Main Content

getCheckResults

Access specific Model Advisor check results

Since R2024b

    Description

    CheckResults = getCheckResults (Results,CheckID) provides you access to Model Advisor analysis results for the check specified by CheckID.

    example

    CheckResults = getCheckResults (Results) provides you access to all Model Advisor analysis check results. Alternatively, you can access results for all checks from the CheckResults property of the ModelAdvisor.SystemResult objects in Results.

    Examples

    collapse all

    Run Model Advisor for the check Check root model Inport block specifications on the sldemo_mdlref_basic model and get the results.

    Open the sldemo_mdlref_basic model.

    openExample('sldemo_mdlref_basic');

    Create a list of the check ID for the check Check root model Inport block specifications.

    checkID = {'mathworks.design.RootInportSpec'};

    Use Model Advisor to run the check on sldemo_mdlref_basic.

    Results = ModelAdvisor.run('sldemo_mdlref_basic',checkID,'DisplayResults','None')
    Results =
    
      1×1 cell array
    
        {1×1 ModelAdvisor.SystemResult}

    Model Advisor returns a ModelAdvisor.SystemResultobject for the sldemo_mdlref_basic model.

    Get the results of the Check root model Inport block specifications check.

    Results{1,1}.getCheckResults (checkID)
      ans = 
    
      CheckResult with properties:
    
               System: 'sldemo_mdlref_basic'
              CheckID: 'mathworks.design.RootInportSpec'
           InstanceID: ''
            CheckName: 'Check root model Inport block specifications'
               Status: 'Passed'
           ResultText: 'Passed'
        ResultDetails: [0×0 ModelAdvisor.ResultDetail]

    The function returns the results for the Check root model Inport block specifications check as a ModelAdvisor.CheckResult object.

    Input Arguments

    collapse all

    Analysis results, specified as a cell array of ModelAdvisor.SystemResult objects. The cell array contains ModelAdvisor.SystemResult objects for each system.

    Check ID associated with check, specified as a character vector or string scalar.

    Example: 'mathworks.jmaab.jc_0231'

    Output Arguments

    collapse all

    Model Advisor check results, returned as a cell array of ModelAdvisor.CheckResult objects for the specified check or all checks.

    Version History

    Introduced in R2024b