Detect and Fix Model Advisor Check Violations
R2026bThe Model Advisor checks your model or subsystem for modeling conditions and configuration settings that cause inaccurate or inefficient simulation and inefficient generated code and code that is unsuitable for safety-critical applications. The Model Advisor checks can help you verify compliance with industry standards and guidelines. By using the Model Advisor, you can implement consistent modeling guidelines across projects and development teams.
A subset of Model Advisor checks support edit-time checking. With edit-time checking, you can check for model conditions while you develop a model. Highlighted blocks in the model editor window alert you to issues in the model.
This tutorial uses the example model sldemo_fuelsys. This model is
an air-fuel ratio control system designed with Simulink® and Stateflow®.
The figures show portions of the sldemo_fuelsys model. The
top-level model is a closed-loop system that consists of a plant (Engine Gas Dynamics)
and a controller (the Fuel Rate Control subsystem). The plant allows engineers to
validate the controller through simulation early in the design cycle. The control logic
is a Stateflow chart that specifies the different modes of operation.



Detect and Fix Model Advisor Check Violations While You Edit
Set your current folder to a writable directory.
Open the model
sldemo_fuelsysby typing this command:openExample('sldemo_fuelsys')To use edit-time checking, on the Modeling tab, select Model Advisor > Edit-Time Checks. The Configuration Parameters dialog box opens and you select the check box for Edit-Time Checks.
The highlighted blocks and subsystems indicate compliance issues.
Pause over a highlighted block and click the warning icon. A dialog box provides a description of the warning. For detailed documentation on the check that detected the issue, click the question mark. These blocks contain edit-time warnings because of incorrect block names.

To exclude a block from a selected check, you can click Suppress.
Open the
Engine Gas Dynamicssubsystem by double-clicking it. Pause over theair/fuel ratiooutput port and click the warning icon.
This output port returns warnings because its name violates two checks: Check for unsupported block names and Check port block names.
Address the warnings by replacing the
/symbol and the space in the block name with underscores. The block is no longer highlighted.Address the warnings for the other highlighted blocks in the
Engine Gas Dynamicssubsystem.
Detect and Fix Model Advisor Check Violations Interactively
On the Modeling tab, select Model Advisor.
Select the top-level model
sldemo_fuelsysfrom the System Hierarchy and click OK.In the left pane, in the By Product > Simulink Check > Modeling Standards > DO-178C/DO-331 folder, select:
Check safety-related diagnostic settings for solvers
Check safety-related diagnostic settings for sample time
Check safety-related optimization settings for logic signals
Right-click DO-178C/DO-331 Checks node, and then select Run Selected Checks.

To review the configuration parameters that are not set to the recommended values, click Check safety-related diagnostic settings for solvers.
To update the parameters to the recommended values, in the toolstrip, click Fix.

Action Report window displays the Model Advisor updates the parameters to the recommended values and details the result.
Repeat step 6 for the Check safety-related diagnostic settings for sample time check.
To verify that your model now passes, rerun the checks.
To generate a results report of the Simulink Check™ checks, select the DO-178C/DO-331 Checks node, and then, in the toolstrip, click Report.
Close the Model Advisor.
Explore Other Options
This table contains a list of common tasks that you can address with Simulink Check.
| Task | Reference |
|---|---|
Simplify and debug complex models. | Highlight Functional Dependencies |
Run Model Advisor checks for compliance with safety standards associated with High-Integrity System Modeling and MAB Control Algorithm Modeling guidelines. | Check Model Compliance by Using the Model Advisor |
| Write custom Model Advisor checks. | Define Custom Model Advisor Checks |
| Create and deploy a custom Model Advisor configuration. | Create and Deploy Model Advisor Custom Configuration and Use Model Advisor Configuration Editor to Customize Model Advisor |
Learn how to collect and view metric data for quality assessments by using the dashboards. | Explore Status and Quality of Testing Activities Using Model Testing Dashboard |
Use the Model Transformer tool and the Clone Detector app to refactor a model to improve model componentization and readability and enable reuse. | Transform Model to Variant System and Enable Component Reuse by Using Clone Detection |
Create a repeatable development and verification process that your team can run locally and in CI. | Continuous Integration |
| Learn more about how to use Simulink products to test models and code, check for design errors, check against standards, measure coverage, and validate the system. | Verification and Validation |