Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

mexErrMsgTxt (C and Fortran) - Issue error message and return to MATLAB prompt

C Syntax

#include "mex.h"
void mexErrMsgTxt(const char *errormsg);

Fortran Syntax

mexErrMsgTxt(errormsg)
character*(*) errormsg

Arguments

errormsg

String containing the error message to be displayed

Description

Call mexErrMsgTxt to write an error message to the MATLAB window. After the error message prints, MATLAB terminates the MEX-file and returns control to the MATLAB prompt.

Calling mexErrMsgTxt does not clear the MEX-file from memory. Consequently, mexErrMsgTxt does not invoke the function registered through mexAtExit.

If your application called mxCalloc or one of the mxCreate* routines to allocate memory, mexErrMsgTxt automatically frees the allocated memory.

Remarks

In addition to the errormsg, the mexerrmsgtxt function determines where the error occurred, and displays the following information. If an error labeled Print my error message occurs in the function foo, mexerrmsgtxt displays:

??? Error using ==> foo
Print my error message

C Examples

See xtimesy.c in the matlabroot/extern/examples/refbook folder .

For additional examples, see convec.c, findnz.c, fulltosparse.c, phonebook.c, revord.c, and timestwo.c in the matlabroot/extern/examples/refbook folder .

See Also

mexErrMsgIdAndTxt, mexWarnMsgIdAndTxt, mexWarnMsgTxt

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

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