Report error messages in Diagnostic Viewer
Create a stage and use the
reportError function to
report an error 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.reportError(error);
output = 1ogical 1
The diagnostic window opens up for the model vdp. It shows the StageName and the error message in red.
Message— Message to be displayed
MExceptionobject | string
This message is displayed as an error in the Diagnostic Viewer.
Example: 'This is a custom error 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.