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.

Simulink.suppressDiagnostic

Suppress a diagnostic from a specific block

Syntax

Simulink.suppressDiagnostic(source, message_id)
Simulink.suppressDiagnostic(diagnostic)

Description

example

Simulink.suppressDiagnostic(source, message_id) suppresses all instances of diagnostics represented by message_id thrown by the blocks specified by source.

Simulink.suppressDiagnostic(diagnostic) suppresses the diagnostics associated with MSLDiagnostic object diagnostic.

Examples

collapse all

Using the model from Suppress Diagnostic Messages Programmatically, use the Simulink.suppressDiagnostic function to suppress the parameter precision loss warning thrown by the Constant block, one.

Simulink.suppressDiagnostic('Suppressor_CLI_Demo/one',...
 'SimulinkFixedPoint:util:fxpParameterPrecisionLoss');

Input Arguments

collapse all

The source of the diagnostic, specified as a block path, block handle, cell array of block paths, or cell array of block handles.

To get the block path, use the gcb function.

To get the block handle, use the getSimulinkBlockHandle function.

Data Types: char | cell

Message identifier of the diagnostic, specified as a character vector or a cell array of character vectors. You can find the message identifier of diagnostics thrown during simulation by accessing the ExecutionInfo property of the Simulink.SimulationMetadata object associated with a simulation. You can also use the lastwarn function.

Data Types: char | cell

Diagnostic specified as an MSLDiagnostic object. Access the MSLDiagnostic object through the ExecutionInfo property of the Simulink.SimulationMetadata object.

Data Types: struct