Documentation

Select and Run Model Advisor Checks

Model Advisor Overview

The Model Advisor checks a model or subsystem for conditions and configuration settings including conditions that cause inaccurate or inefficient simulation of the system that the model represents. If you have金宝app®Coder™orSimulink Check™, the Model Advisor can check for model settings that cause generation of inefficient code or code unsuitable for safety-critical applications. If you haveSimulink Design Verifier™, the Model Advisor can check for design errors. If an error is reported, you can view a test case that reproduces the error.

The Model Advisor produces a report that lists the suboptimal conditions or settings that it finds, and proposes better model configuration settings where appropriate.

Software is inherently complex and may not be completely free of errors. Model Advisor checks might contain bugs. MathWorks®reports known bugs brought to its attention on its Bug Report system at//www.tatmou.com/support/bugreports/. The bug reports are an integral part of the documentation for each release. Examine periodically all bug reports for a release as such reports may identify inconsistencies between the actual behavior of a release you are using and the behavior described in this documentation.

While applying Model Advisor checks to your model increases the likelihood that your model does not violate certain modeling standards or guidelines, their application cannot guarantee that the system being developed will be safe or error-free. It is ultimately your responsibility to verify, using multiple methods, that the system being developed provides its intended functionality and does not include any unintended functionality.

Run Model Advisor Checks

  1. Open the Model Advisor example modelsldemo_mdladv.

  2. 启动模式的顾问。在模型编辑器中,希利ctAnalysis>Model Advisor>Model AdvisororModel Advisor Dashboard. The dashboard preserves the checks used in the previous analysis. You can run these same checks without reloading them, saving analysis time.

  3. In the Model Explorer, in theContentspane, selectAdvice formodel.modelis the name of the model that you want to check.

  4. In the Model Editor, right-click the subsystem that you want to check, and in the context menu selectModel Advisor.

  5. At the command prompt, entermodeladvisor('sldemo_mdladv').

  6. In the System Selector dialog box, select the model or system that you want to analyze, for example,sldemo_mdladv. ClickOK.

  7. In the left pane of the Model Advisor, expand theBy ProductandBy Taskfolders to display the subfolders. TheBy Taskfolders display checks related to specific tasks. For example, to run checks to determine if your model is configured for simulation accuracy, select checks in theSimulation Accuracyfolder.

  8. TheBy Productfolders display checks available with specific products.

  9. SelectSettings>Preferencesto control the folders that are displayed.

  10. In the left pane, select the checks to run on your model. For example, select the checks in theBy Product > Simulinkfolder.

Display Check Results

To display an HTML report of check results:

  1. In the right pane of the Model Advisor, selectShow report after run.

  2. On the toolbar, clickRun Selected Checksor. After the Model Advisor runs the checks, the results appear in a browser if you selected the option to show the report.

After reviewing the check results in the Model Advisor window, you can choose to fix warnings or failures.

Set Model Advisor Window Preferences

To open the Model Advisor Preferences dialog box, on the toolbar, selectSettings>Preferences.

Action Select

Display the check available for each product.

Show By Product Folder

Display checks related to specific tasks.

Show By Task Folder

Display the check Title, TitleId, and location of the MATLAB®source code for the check.

Show Source Tab. TheSourcetab displays check source information.

显示检查被排除在模型广告visor analysis.

Show Exclusion tab. TheExclusionstab displays checks that are excluded from the Model Advisor analysis.

Display and Run Checks

Action Model Advisor Options

Display checks related to specific tasks.

SelectBy Task.

Display the check available for each product.

SelectBy Product.

Find checks and folders.

In theFind:field, enter text and click theFind Nextbutton (). The Model Advisor searches in check names, folder names, and analysis descriptions.

Reset the status of the checks to not run.

In the left pane, right-clickModel Advisorand selectReset.

Select some or all of the checks.

Select the check and folder check boxes.

Run the selected checks.

On the toolbar of the Model Advisor window, clickRun selected checks().

Run the Same Set of Checks Consistently

To consistently run the same set of checks on your model, use the Model Advisor dashboard.

Action Option

Select and view checks.

In the Model Advisor window, click theSwitch to standard viewtoggle () button.

Run checks.

ClickRun checks().

View the report in a separate browser window.

ClickOpen Report.

View highlighted results.

Click theEnable highlightingtoggle () button.

Run Model Checks Programmatically

If you haveSimulink Check, you can create MATLAB scripts and functions so that you can run the Model Advisor programmatically. For example, you can create aModelAdvisor.runfunction to check whether your model passes a specified set of the Model Advisor checks every time that you open the model and start a simulation. If you haveSimulink Coder, the function can generate code from the model.

Access Other Advisors

You can use the Model Advisor window to access other Advisors.

Action Select

Configure your model to meet code generation objectives.

Code Generation Advisor. SeeApplication Objectives Using Code Generation Advisor(Simulink Coder).

Upgrade and improve models with the current release.

Upgrade Advisor. SeeConsult the Upgrade Advisor.

Improve the simulation performance of your model.

Performance Advisor. SeeImprove Simulation Performance Using Performance Advisor.

See Also

Related Examples

More About

Was this topic helpful?