| MATLAB® | ![]() |
#include "mex.h" void mexErrMsgIdAndTxt(const char *errorid, const char *errormsg, ...);
mexErrMsgIdAndTxt(errorid, errormsg) character*(*) errorid, errormsg
String containing a MATLAB message identifier. For information on creating identifiers, see Message Identifiers in the MATLAB Programming Fundamentals documentation.
String containing the error message to be displayed. In C, the string may include formatting conversion characters, such as those used with the ANSI® C sprintf function.
In C, any additional arguments needed to translate formatting conversion characters used in errormsg. Each conversion character in errormsg is converted to one of these values.
Call mexErrMsgIdAndTxt to write an error message and its corresponding identifier to the MATLAB window. After the error message prints, MATLAB terminates the MEX-file and returns control to the MATLAB prompt.
Calling mexErrMsgIdAndTxt does not clear the MEX-file from memory. Consequently, mexErrMsgIdAndTxt does not invoke the function registered through mexAtExit.
If your application called mxCalloc or one of the mxCreate* routines to allocate memory, mexErrMsgIdAndTxt automatically frees the allocated memory.
Note If you get warnings when using mexErrMsgIdAndTxt, you may have a memory management compatibility problem. For more information, see Memory Management Issues in the External Interfaces documentation. |
In addition to the errorid and errormsg, the mexerrmsgtxt function determines where the error occurred, and displays the following information. For example, in the function foo, mexerrmsgtxt displays:
??? Error using ==> foo
mexErrMsgTxt, mexWarnMsgIdAndTxt, mexWarnMsgTxt
![]() | mexCallMATLAB (C and Fortran) | mexErrMsgTxt (C and Fortran) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |