| External Interfaces/API | ![]() |
Using an Open MATLAB
You can make a MATLAB engine program use a MATLAB that is already open by starting that MATLAB with the /Automation command line argument. This causes the engOpen call to connect to a session of MATLAB that is already running. However, it will cause all engOpen calls to connect to that MATLAB session, so it will only work for one instance. If you want to do this with two sessions of MATLAB, they would both connect.
The /Automation argument also causes the command window to be minimized. You must open it manually.
Note
For more information on the /Automation command line argument and ActiveX in general, see Introducing MATLAB ActiveX Integration.
|
d:\matlab\bin\win32\matlab.exe /Automation
where d:\matlab\bin\win32 represents the path to the MATLAB
executable.
$MATLAB/extern/examples/eng_mat, where $MATLAB is the MATLAB root directory.engwindemo.c example.engwindemo program by typing at the MATLAB prompt
!engwindemo
This does not start another MATLAB process, but rather uses the MATLAB process that is already open.
| Note You cannot make a MATLAB engine program use a MATLAB that is already open on the UNIX platform. |
| Calling MATLAB From a Fortran Application | Compiling and Linking Engine Programs | ![]() |