Explanation

sllastdiagnostic and sllasterror will be removed in a future release. To obtain information about an error (such as the message ID and the stack trace), use an identifier on the catch block instead.

If you specify a variable with a catch block and an error occurs in the try block, MATLAB enters the catch block and assigns the MException object to the catch variable. The MException object contains the error message, the message ID, and the stack trace. To pass this information to a calling function, either return the MException object as an output of your function, or call its rethrow method to rethrow the error. There is no need to save and restore sllasterror around such a try/catch block.


Suggested Action

Specify a variable with a catch block, as described in ”The try-catch Statement”.