restore

Class: Simulink.SuppressedDiagnostic
Package: Simulink

Remove specified diagnostic suppressions

Syntax

restore(SuppressedDiagnostic)

Description

restore(SuppressedDiagnostic) removes the specified suppressed diagnostic object.

Input Arguments

expand all

Simulink.SuppressedDiagnostic object

Examples

expand all

Using the model from Suppress Diagnostic Messages Programmatically, create and then restore a diagnostic suppression.

Create a Simulink.SuppressedDiagnostic object, suppression to suppress the parameter precision loss warning from the Constant block, one.

suppression = Simulink.SuppressedDiagnostic('Suppressor_CLI_Demo/one',...
'SimulinkFixedPoint:util:fxpParameterPrecisionLoss');

You can restore the diagnostic using the restore method.

restore(suppression);

Using the model from Suppress Diagnostic Messages Programmatically, restore all diagnostic suppressions associated with a model.

Use the Simulink.suppressDiagnostic function to suppress the parameter precision loss and parameter underflow warnings from the Constant block, one.

diags = {'SimulinkFixedPoint:util:fxpParameterPrecisionLoss', 'SimulinkFixedPoint:util:fxpParameterUnderflow'};
Simulink.suppressDiagnostic('Suppressor_CLI_Demo/one',diags);

Use the Simulink.getSuppressedDiagnostics function to get all suppressions associated with the model, returned as an array of Simulink.SuppressedDiagnostic objects.

suppressed_diagnostics = Simulink.getSuppressedDiagnostics('Suppressor_CLI_Demo')
suppressed_diagnostics = 

  1×2 SuppressedDiagnostic array with properties:

    Source
    Id
    LastModifiedBy
    Comments
    LastModified

Restore all diagnostics using the restore method and iterating through the suppressed_diagnostics array.

for iter = 1:numel(suppressed_diagnostics)
    restore(suppressed_diagnostics(iter));
end
Introduced in R2016b