| MATLAB Application Program Interface Reference | Help Desk |
engOpen
Start a MATLAB engine session
integer*4 function engOpen(startcmd) integer*4 ep character*(*) startcmd
ep
startcmd
Character array to start MATLAB process.
engOpen(startcmd) starts a MATLAB process using the command specified in startcmd, establishes a connection, and returns a unique engine identifier, or 0 if the open fails.
On the UNIX system, if startcmd is empty, engOpen starts MATLAB on the current host using the command matlab. If startcmd is a hostname, engOpen starts MATLAB on the designated host by embedding the specified hostname string into the larger string:
"rsh hostname \"/bin/csh -c 'setenv DISPLAY\
hostname:0; matlab'\""
If startcmd is anything else (has white space in it, or nonalphanumeric characters), it is executed literally to start MATLAB.
engOpen performs the following steps:
rsh for remote execution).
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.
Note: Fortran engine routines are not available on Windows.