| Using Simulink | ![]() |
Creating Custom Simulation Error Messages
The Simulation Diagnostics 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 Fcn block. Thus, you can use the MATLAB error function in callbacks and S-functions or in the MATLAB Fcn 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 Diagnostics Viewer.
Including Hyperlinks in Error Messages
You can include hyperlinks to blocks, text files, and directories.
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.,
displays a text hyperlink to the block Mu in the current model in the error message. Clicking the hyperlink displays the block in the model window.
displays a text hyperlink to the file test.data in the error message. Clicking the link displays the file in your preferred MATLAB editor.
displays a text hyperlink to the c:/work directory. Clicking the link opens a system command window (shell) and sets its working directory to c:/work.
| Note The text hyperlink is enabled only if the corresponding block exists in the current model or if the corresponding file or directory exists on the user's system. |
| Diagnosing Simulation Errors | Improving Simulation Performance and Accuracy | ![]() |
© 1994-2005 The MathWorks, Inc.