Using Simulink    

Creating Custom Simulation Error Messages

The Simulink Diagnostic Viewer displays the output of any instance of the MATLAB error function executed during a simulation, including instances invoked by block or model callbacks or S-functions that you create or that are executed by the MATLAB Function block. Thus, you can use the MATLAB error function in callbacks and S-functions or in the MATLAB Function block to create simulation error messages specific to your application.

For example, in the following model,

the MATLAB Fcn block invokes the following function

Executing this model displays an error message in the Simulation Diagnostic Viewer:

Including Hyperlinks in Error Messages

You can include hyperlinks to blocks, text files, and directories.

Object Links.   To include a hyperlink to a block, path, or directory, include the item's path in the error message enclosed in quotation marks, e.g.,


  Diagnosing Simulation Errors Improving Simulation Performance and Accuracy