| External Interfaces/API Reference | ![]() |
C Syntax
#include "engine.h"
int engEvalString(Engine *ep, const char *string);
string
Description
engEvalString evaluates the expression contained in string for the MATLAB engine session, ep, previously started by engOpen. It returns a nonzero value if the MATLAB session is no longer running, and zero otherwise.
On UNIX systems, engEvalString sends commands to MATLAB by writing down a pipe connected to MATLAB's stdin. Any output resulting from the command that ordinarily appears on the screen is read back from stdout into the buffer defined by engOutputBuffer. To turn off output buffering, use
engOutputBuffer(ep, NULL, 0);
Under Windows on a PC, engEvalString communicates with MATLAB via ActiveX.
Examples
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.
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.
| engClose | engGetArray | ![]() |