Documentation

Limit Model Checks 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_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 store the exclusion in the model file.

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

    1. Right-click the Out4 block and select Model Advisor > Exclude all blocks of type Outport > Identify unconnected lines, input ports, and output ports.

    2. In the Model Advisor Exclusion Editor dialog box, click OK to store the exclusion in the model file.

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

    • Select the Show report after run check box.

    • Click 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?