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.
Open the model
sldemo_fuelsys. In the MATLAB® Command Window, enter:
In the model window, open the Modeling tab and click Model Advisor. A System Selector dialog box opens. Click OK.
In the left pane of the Model Advisor, navigate to By Task > Model Metrics. Select the Count Metrics, Complexity Metrics, and Readability Metrics checks.
Right-click the Model Metrics folder and click Run Selected Checks.
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.
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.