This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Address Model Check Results

To find warnings or failures in your model:

  • Open the model sldemo_mdladv. From the toolbar, select Analysis > Model Advisor > Model Advisor. Select checks By Product > Simulink.

  • On the toolbar of the Model Advisor window, click Run selected checks (). The Model Advisor finds warnings or failures in the model.

Address Model Check Results with Highlighting

To indicate the analysis results for individual Model Advisor checks, use color highlighting on the model diagram. Highlighting is available for Simulink® blocks and Stateflow® charts. Blocks that pass a check, fail a check, or cause a check warning are highlighted in color in the model window. On the toolbar of the Model Advisor window, click Enable highlighting (), select Highlighting > Enable Highlighting.

After selecting the highlighting feature, the model window and a Model Advisor Highlighting information window open. The Model Advisor Highlighting information window provides a link to the Model Advisor window where you can review the check results.

Yellow with orange border

Blocks that cause the check failure or warning.

White with orange border

Subsystem with blocks that cause the check warning or failure.

White with gray border

Blocks or subsystems without highlighting.

Gray with black border

Blocks that are excluded from the check.

White with black border

Subsystems that are excluded from the check.

If a check warns or fails, and the model window highlights blocks in gray, closely examine the results in the Model Advisor window. A Model Advisor check can fail or warn due to your parameter or diagnostic settings.

After you run a Model Advisor analysis and select the highlighting feature, checks with highlighted results are indicated with an icon in the Model Advisor window. Highlighting is not available for some checks. Selecting By Product > Simulink displays Model Advisor checks in the Model Advisor Highlighting window that do not highlight results.

In the left pane of the Model Advisor window, select the highlighted check Identify unconnected lines, input ports, and output ports. In the model editor window, the Model Advisor highlights the blocks or components related to the warning. In this case, the Model Advisor finds a Gain block and an Outport block not properly connected to the model.

In the right pane of the Model Advisor window, there is further information about the warning.

The Recommended Action suggests how to fix the warning or error. In this case, connect the disconnected blocks.

In the left pane of the Model Advisor window, select the highlighted check Identify questionable operations for strict single-precision design. In the model editor window, the Model Advisor highlights the blocks or components related to the warning. In this case, the Model Advisor finds an Outport block that uses double precision due to a setting of the Configuration Parameter Default for underspecified data type.

In the right pane of the Model Advisor window, you see further detail on the single-precision warning.

The default input of the Outport block is set to double. Model Advisor generates a warning because the Outport block is not connected to another block. After reviewing the check results in the model window and the Model Advisor window, you can choose to fix warnings or failures.

To view model blocks that are excluded from the Model Advisor checks, on the Model Advisor window toolbar, select Highlighting > Highlight Exclusions. If you have Simulink Check™, you can create or modify exclusions to the Model Advisor checks.

Fix a Model Check Warning or Failure

When a model or referenced model has a suboptimal condition, checks can fail. A warning result is informational. You can fix the reported issue or move on to the next task. For more information on why a specific check does not pass, see the documentation for that check.

Manually Fix Warnings or Failures

To manually fix warnings or failures, checks have an Analysis Result box that describes the recommended actions.

  1. Optionally, save a model and data restore point so that you can undo your changes.

  2. In the Analysis Result box, review the recommended actions to make changes to your model.

  3. To verify that the check passes, rerun the check.

    When you fix a warning or failure, rerun all checks to update the results of all checks. If you do not rerun all checks, the Model Advisor can report an invalid check result.

Automatically Fix Warnings or Failures

Some checks have an Action box that you can use to automatically fix failures. The action box applies all of the recommended actions listed in the Analysis Result box.

  1. Optionally, save a model and data restore point so that you can undo your changes.

  2. In the Action box, click Modify All or Modify.

    The Action Result box displays a table of changes.

  3. To verify that the check passes, rerun the check.

    When you fix a warning or failure, rerun all checks to update the results of all checks. If you do not rerun all checks, the Model Advisor can report an invalid check result.

Batch-Fix Warnings or Failures

Some checks have an Explore Result button that opens the Model Advisor Result Explorer. With the Model Advisor Result Explorer, you can quickly locate, view, and change elements of a model.

The Model Advisor Result Explorer helps you to modify only the items that the Model Advisor is checking.

If a check does not pass and you want to explore the results and make batch changes:

  1. Optionally, save a model and data restore point so that you can undo your changes.

  2. In the Analysis box, click Explore Result.

  3. In the Model Advisor Result Explorer, you can modify block parameters.

  4. In the Model Advisor window, rerun the check to verify that it passes.

    When you fix a warning or failure, rerun all checks to update the results of all checks. If you do not rerun all checks, the Model Advisor can report an invalid check result.

Revert Changes

The Model Advisor provides a model and a data restore point capability for reverting changes that you made in response to recommendations from the Model Advisor. You can also restore the default configuration of the Model Advisor. A restore point is a snapshot in time of the model, base workspace, and Model Advisor. The Model Advisor maintains restore points for the model or subsystem through multiple sessions of MATLAB®.

Note

A restore point saves only the current working model, base workspace variables, and the Model Advisor tree. It does not save other items, such as libraries and referenced models.

Restore Default Configuration

In the Model Advisor window, select Settings > Restore Default Configuration.

Save a Restore Point

You can save a restore point and give it a name and description. Or, the Model Advisor can name the restore point.

  1. In the Model Advisor window, select File > Save Restore Point As.

  2. In the Name field, enter a name for the restore point.

  3. In the Description field, you can optionally add a description to help identify the restore point.

  4. Click Save.

    The Model Advisor saves a restore point of the current model, base workspace, and Model Advisor status.

To quickly save a restore point, in the Model Advisor window, select File > Save Restore Point. The Model Advisor saves a restore point with the name autosaven. n is the sequential number of the restore point. If you use this method, you cannot change the name of, or add a description to, the restore point.

Load a Restore Point

  1. Optionally, save a model and data restore point so that you can undo your changes.

  2. Select File > Load Restore Point.

  3. In the Load Model and Data Restore Point dialog box, select the restore point that you want.

  4. Click Load.

    The Model Advisor issues a warning that the restoration removes changes that you made after saving the restore point.

  5. To load the restore point that you selected, click Load.

    The Model Advisor reverts the model, base workspace, and Model Advisor status.

Related Topics