MATLAB Application Program Interface Reference Help Desk

mexPrintf

Purpose

ANSI C printf-style output routine

C Syntax

Arguments

format, ...

ANSI C 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 C printf 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

Consider a MEX-file named DispComp that expects two input arguments and determines which of them has the larger first element.

In MATLAB, create two vectors:

Pass v1 and v2 as arguments to DispComp:

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

See Also

mexErrMsgTxt, mexWarnMsgTxt



[ Previous | Help Desk | Next ]