Documentation Center

  • Trial Software
  • Product Updates

Limit Scope of Model Advisor Analysis By Excluding Gain and Outport Blocks

This example shows how to exclude a gain block and all outport blocks from a Model Advisor check during a Model Advisor analysis. By excluding individual blocks from checks, you limit the scope of the analysis and might save time during model development and verification.

  1. At the MATLAB® command line, type sldemo_mdladvsldemo_mdladv.

  2. From the model window, select Analysis > Model Advisor > Model Advisor to open the Model Advisor.

  3. A System Selector — Model Advisor dialog box opens. Click OK.

  4. If the By Product folder is not displayed in the Model Advisor window, select Show By Product Folder from the Settings > Preferences dialog box.

  5. In the left pane of the Model Advisor window, expand By Product > Simulink. Select the Show report after run check box to see an HTML report of check results after you run the checks.

  6. Run the selected checks by clicking the Run selected checks button. After the Model Advisor runs the checks, an HTML report displays the check results in a browser window. The check Identify unconnected lines, input ports, and output ports triggers a warning.

  7. In the left pane of the Model Advisor window, select the check By Product > Simulink > Identify unconnected lines, input ports, and output ports.

  8. In the Model Advisor window, click the Enable highlighting button ( ).

    • The model window opens. The blocks causing the Identify unconnected lines, input ports, and output ports check warning are highlighted in yellow.

    • The Model Advisor Highlighting window opens with a link to the Model Advisor window. In the Model Advisor window, you can find more information about the check results and how to fix the warning condition.

  9. After reviewing the check results, exclude the Gain2 block from all Model Advisor checks:

    1. In the model window, right-click the Gain2 block and select Model Advisor > Exclude block only > All Checks.

    2. In the Model Advisor Exclusion Editor dialog box, double-click in the first row of the Rationale field, and enter Exclude gain block.

    3. Click OK to create the exclusion file.

    4. In the Save Exclusion File as dialog box, click Save to create a exclusion file with the default name sldemo_mdladv_exclusions.

  10. After reviewing the check results, exclude all Outport blocks from the Identify unconnected lines, input ports, and output ports check:

    1. In the model window, right-click the Out4 block and select Model Advisor > Exclude all blocks of type Outport > Select checks.

    2. In the Check Selector dialog box, scroll down and select Identify unconnected lines, input ports, and output ports. Click OK.

      Alternately, to exclude all Outport blocks from the Identify unconnected lines, input ports, and output ports check, right-click the Out4 block and select Model Advisor > Exclude all blocks of type Outport > Identify unconnected lines, input ports, and output ports.

    3. In the Model Advisor Exclusion Editor dialog box, click OK to also exclude all Outport blocks from the Identify unconnected lines, input ports, and output ports check. The sldemo_mdladv_exclusions file is updated with the Outport block exclusions.

  11. In the left pane of the Model Advisor window, select By Product > Simulink and then:

    • Select the Show report after run check box.

    • Select Run Selected Checks to run a Model Advisor analysis.

  12. After the Model Advisor completes the analysis, you can view exclusion information for the Identify unconnected lines, input ports, and output ports check in the:

    • HTML report:

    • Model Advisor window. In the left pane of the Model Advisor window, select By Product > Simulink > Identify unconnected lines, input ports, and output ports.

    • Model window. In the left pane of the Model Advisor window, select By Product > Simulink > Identify unconnected lines, input ports, and output ports. Then click the Enable highlighting button ( ).

  13. Close sldemo_mdladv.

Related Examples

More About

Was this topic helpful?