Main Content

mexWarnMsgIdAndTxt (C and Fortran)

Warning message with identifier

C Syntax

#include "mex.h"
void mexWarnMsgIdAndTxt(const char *warningid,
  const char *warningmsg, ...);

Fortran Syntax

#include "fintrf.h"
subroutine mexWarnMsgIdAndTxt(warningid, warningmsg)
character*(*) warningid, warningmsg

Description

The mexWarnMsgIdAndTxt function writes a warning message to the MATLAB® command prompt. The warnings displayed are the same as warnings issued by the MATLAB warning function. To control the information displayed or suppressed, call the warning function with the desired settings before calling your MEX file.

Unlike mexErrMsgIdAndTxt, calling mexWarnMsgIdAndTxt does not terminate the MEX file.

Input Arguments

expand all

Warning identifier containing a MATLAB message identifier, specified as const char* in C or character*(*) in Fortran. For information on creating identifiers, see MException.

String to display, specified as const char* in C or character*(*) in Fortran. In C, the function supports either UTF-8 or local code page (LCP) encoding and the string can include conversion specifications, used by the ANSI® C printf function. The encoding for both the message text and the conversion arguments must be the same.

In C, any arguments used in the message. Each argument must have a corresponding conversion specification. Refer to your C documentation for printf conversion tables.

Version History

Introduced before R2006a

expand all