| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
#include "mex.h" void mexErrMsgIdAndTxt(const char *errorid, const char *errormsg, ...);
subroutine 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 to display. In C, the string can include conversion specifications, used by the ANSI® C printf function.
In C, any arguments used in the message. Each argument must have a corresponding conversion specification.
The mexErrMsgIdAndTxt function writes an error message to the MATLAB window. For more information, see the error function syntax statement using a message identifier. 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 might 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
![]() | mexCallMATLABWithTrap (C and Fortran) | mexErrMsgTxt (C and Fortran) | ![]() |

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 |