engOutputBuffer (C and Fortran) - Specify buffer for MATLAB output

C Syntax

#include "engine.h"
int engOutputBuffer(Engine *ep, char *p, int n);

Fortran Syntax

integer*4 engOutputBuffer(ep, p)
mwPointer ep
character*n p

Arguments

ep

Engine pointer

p

Pointer to character buffer

n

Length of buffer p

Returns

1 if you pass it a NULL engine pointer. Otherwise, it returns 0.

Description

engOutputBuffer defines a character buffer for engEvalString to return any output that ordinarily appears on the screen.

The default behavior of engEvalString is to discard any standard output caused by the command it is executing. A call to engOutputBuffer with a buffer of nonzero length tells any subsequent calls to engEvalString to save output in the character buffer pointed to by p.

To turn off output buffering in C, use:

engOutputBuffer(ep, NULL, 0);

To turn off output buffering in Fortran, use:

engOutputBuffer(ep, '')

C Examples

UNIX[1] Operating Systems

See engdemo.c in the eng_mat subdirectory of the examples directory for a sample program that illustrates how to call the MATLAB engine functions from a C program.

Microsoft Windows Operating Systems

See engwindemo.c in the eng_mat subdirectory of the examples directory for a sample program that illustrates how to call the MATLAB engine functions from a C program for Windows systems.

Fortran Examples

See fengdemo.F in the eng_mat subdirectory of the examples directory for a sample program that illustrates how to call the MATLAB engine functions from a Fortran program.

See Also

engOpen, engEvalString


[1] UNIX is a registered trademark of The Open Group in the United States and other countries.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS