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

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