Main Content

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, enter :

    openExample('sldemo_mdladv')

  2. From the model window, in the Modeling tab, select Model Advisor to open the Model Advisor. A System Selector dialog opens. Click OK.

  3. In the left pane of the Model Advisor window, expand By Product > Simulink.

  4. Run the selected checks by clicking the Run checks button.

  5. After the Model Advisor runs the checks, click Reports, an HTML report is generated that displays the check results in a browser window. The check Identify unconnected lines, input ports, and output ports triggers a warning.

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

  7. In the Report section, you can find more information about the check results and how to fix the warning condition.

  8. 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.

      Navigation to All checks in the menu

    2. In the Model Advisor Exclusion Editor dialog box, in the Rationale field, enter Exclude gain block.

    3. Click OK to store the exclusion in the model file.

  9. 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 > Select Checks > 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.

  10. In the left pane of the Model Advisor window, select By Product > Simulink and then click Run Checks to run a Model Advisor analysis.

  11. After the Model Advisor completes the analysis, Use the Report button to generate a report, and you can view exclusion information for the Identify unconnected lines, input ports, and output ports check in the:

    • HTML report:

      The check passed and the two exclusions are listed in the Check Exclusions Rules table

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

      The check passed and the two exclusions are listed in the Check Exclusions Rules table

  12. Close sldemo_mdladv.

See Also