mexErrMsgIdAndTxt (C and Fortran) - Issue error message with identifier and return to MATLAB® prompt

C Syntax

#include "mex.h"
void mexErrMsgIdAndTxt(const char *errorid,  
const char *errormsg, ...);

Fortran Syntax

mexErrMsgIdAndTxt(errorid, errormsg)
character*(*) errorid, errormsg

Arguments

errorid

String containing a MATLAB message identifier. For information on creating identifiers, see Message Identifiers in the MATLAB Programming Fundamentals documentation.

errormsg

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.

Description

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.

Remarks

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

See Also

mexErrMsgTxt, mexWarnMsgIdAndTxt, mexWarnMsgTxt

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS