Main Content

Simulink.getSuppressedDiagnostics

Return Simulink.SuppressedDiagnostic objects associated with a block, subsystem, or model

Description

suppressed_diagnostics = Simulink.getSuppressedDiagnostics(source) returns an array of Simulink.SuppressedDiagnostic objects that are associated with the specified source.

example

Examples

collapse all

To get all suppressed diagnostics associated with a specified block, use getDiagnosticObjects.m, suppressor_script.m, and the Suppressor_CLI_Demo.slx model. The getDiagnosticObjects.m function queries the simulation metadata to access diagnostics that were thrown during simulation. The suppressor_script.m script contains the commands for suppressing and restoring diagnostics to the Suppressor_CLI_Demo model. Open the model. To access Simulink.SimulationMetadata class, set the ReturnWorkspaceOutputs parameter value to 'on'. Simulate the model.

  model = 'Suppressor_CLI_Demo';
  open_system(model);
  set_param(model,'ReturnWorkspaceOutputs','on');
  out = sim(model);

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');

Get the Simulink.SuppressedDiagnostic objects associated with the block.

  suppressed_diagnostic =
  Simulink.getSuppressedDiagnostics('Suppressor_CLI_Demo/one');

Input Arguments

collapse all

The source of the diagnostic, specified as a model, subsystem, 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

Output Arguments

collapse all

Suppressed diagnostics, returned as an array of Simulink.SuppressedDiagnostic objects.

Version History

Introduced in R2016b