This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Error Handling

Generate warnings and errors, capture data on cause of error

MuPAD Functions

errorRaise a user-specified exception
getlasterrorRetrieve the last error number and text
lasterrorReproduce the last error
traperrorTrap errors
warningPrint a warning message


Write Error and Warning Messages

When writing a procedure in MuPAD®, you can include error and warning messages in your procedure.

Handle Errors

Typically, when a MuPAD procedure encounters an error caused by evaluation of an object, the procedure terminates, the system returns to an interactive level and displays an error message.

Was this topic helpful?