Report warning messages in Diagnostic Viewer
Create a stage and use the
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.
Message— Message to display
MExceptionobject | string
This message is displayed as a warning in the Diagnostic Viewer.
Example: 'This is a custom warning message.'
Value— Component name
The name of the component specified as the comma-separated pair consisting of 'Component' and a character vector or string.
output— shows the success or failure of the operation
Shows whether the message was displayed successfully.