When the ERROR function is used in a file, the error message is preceded by information about where the error occurred, and the stack field of the structure returned by LASTERROR. The stack field contains a structure array in the same format as the output of dbstack('-completenames'). This stack points to the line, function, and file in which the error occurred.
I want to use ERROR to display only the error message, leaving out the information about the stack.
Best Answer