MATLAB Application Program Interface Reference Help Desk

mexErrMsgTxt

Purpose

Issue error message and return to the MATLAB prompt

C Syntax

Arguments

error_msg

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 exit function.

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

Examples

Determine the number of input arguments passed to the MEX-file. If that number is not 2, display an error message and return to the MATLAB prompt

For an additional example, see mexErrMsgTxt.c in the mex subdirectory of the examples directory.

See Also

mexWarnMsgTxt



[ Previous | Help Desk | Next ]