MATLAB Application Program Interface Reference Help Desk

engEvalString

Purpose

Evaluate expression in string

C Syntax

Arguments

ep

Engine pointer.

string

String to execute.

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.

Under Windows on a PC, engEvalString communicates with MATLAB via ActiveX.

Examples

Send a simple mxArray to the engine, compute its eigenvalues, get back the vector containing the eigenvalues, and print the second one:

For UNIX:

For Windows:

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.



[ Previous | Help Desk | Next ]