Function Reference
— Built-in Function: [msg, msgid] = lasterr (msg, msgid)

Without any arguments, return the last error message. With one argument, set the last error message to msg. With two arguments, also set the last message identifier.