Main Content

Collect Model Metrics Using the Model Advisor

You can use the Model Advisor metrics to analyze the size, complexity, and readability of your model.

The results of these metrics can help you verify compliance with industry standards and guidelines.

You can run model metrics in the Model Advisor By Task > Model Metrics subfolder.

This example uses the sldemo_fuelsys model to demonstrate how to collect these metrics.

  1. Open the model sldemo_fuelsys. In the MATLAB® Command Window, enter:

    openExample('sldemo_fuelsys')
  2. In the model window, open the Modeling tab and click Model Advisor. A System Selector dialog box opens. Click OK.

  3. In the left pane of the Model Advisor, navigate to By Task > Model Metrics. Select the Count Metrics, Complexity Metrics, and Readability Metrics checks.

    Model Advisor pane with the checks selected

  4. Right-click the Model Metrics folder and click Run Selected Checks.

  5. After the Model Advisor runs the analysis, explore the metrics results by selecting a model metric in the Check Selector pane of the Model Advisor window. In the Count Metrics folder, select Simulink block metric. The Report tab shows a table for the number of blocks at the root model level and subsystem level.Model Advisor Report tab with table of metric results

    Alternatively, you can view the analysis results in the Model Advisor report.

You can use the metric results to help compare your model to industry recommendations for model size, complexity, and readability.

Related Topics