Evaluate expression in string
#include "engine.h" int engEvalString(Engine *ep, const char *string);
#include "engine.h" integer*4 engEvalString(ep, string) mwPointer ep character*(*) string
ep
Engine pointer
string
String to execute
1
if the engine session is no longer running
or the engine pointer is invalid or NULL
. Otherwise,
returns 0
even if the MATLAB® engine session
cannot evaluate the command.
engEvalString
evaluates the expression
contained in string
for the MATLAB engine
session, ep
, previously started by engOpen
.
On UNIX® systems, engEvalString
sends
commands to the MATLAB workspace by writing down a pipe connected
to the MATLAB stdin
process. MATLAB reads
back from stdout
any output resulting from
the command that ordinarily appears on the screen, into the buffer
defined by engOutputBuffer
.
To turn off output buffering in C, use:
engOutputBuffer(ep, NULL, 0);
To turn off output buffering in Fortran, use:
engOutputBuffer(ep, '')
On a Windows® system, engEvalString
communicates
with MATLAB software using a Component Object Model (COM) interface.
See these examples in
:matlabroot
/extern/examples/eng_mat
engdemo.c
for
a C example on UNIX operating systems.
engwindemo.c
for
a C example on Microsoft® Windows operating systems.
fengdemo.F
for
a Fortran example.