Main Content

sldiagviewer.reportWarning

Report warning messages in Diagnostic Viewer

Description

example

output = sldiagviewer.reportWarning(Message) reports a message as warning in the diagnostic Viewer.

myStage = sldiagviewer.reportWarning(__,'Component', Value) specifies the name of the component. For example, Model Advisor or Stateflow.

Examples

collapse all

Create a stage and use the reportWarning function to report a warning message in the Diagnostic Viewer for the specified model.

>> vdp >> 

% Create a stage 
my_stage = sldiagviewer.createStage('StageName', 'ModelName', 'vdp'); 
%% write some code inside try, which will throw an error 
try 
 i = p; 
catch error 
end 
sldiagviewer.reportWarning(error);

output =
     1ogical
      1

The diagnostic window opens up for the model vdp. It shows the StageName and the warning message in yellow.

Diagnostic Viewer showing StageName and waning message in yellow

Input Arguments

collapse all

This message is displayed as a warning in the Diagnostic Viewer.

Example: 'This is a custom warning message.'

The name of the component specified as the comma-separated pair consisting of 'Component' and a character vector or string.

Example: Stateflow

Output Arguments

collapse all

Shows whether the message was displayed successfully.

Introduced in R2014a