| MATLAB Application Program Interface | Search  Help Desk |
| mexPrintf | Examples See Also |
ANSI C printf-style output routine
C Syntax
#include "mex.h" int mexPrintf(const char *format, ...);
Arguments
format, ...printf-style format string and optional arguments.
Description
This routine prints a string on the screen and in the diary (if the diary is in use). It provides a callback to the standard Cprintf routine already linked inside MATLAB, and avoids linking the entire stdio library into your MEX-file.
In a MEX-file, you must call mexPrintf instead of printf.
Examples
Seemexfunction.c in the mex subdirectory of the examples directory. For an additional example, see phonebook.c in the refbook subdirectory of the examples directory.
See Also
mexErrMsgTxt, mexWarnMsgTxt