I am repeatedly calling a matlab script MyMatlabScript
from another program (written in Erlang). I am doing this using a batch file containing the following:
matlab -nodesktop -nosplash -wait -r "addpath('C:/...'); MyMatlabScript; %quit;"
This means that Matlab has to launch everytime I run the batch file script. It works but is slow*.
To improve performance I would like to be able to launch Matlab once and then somehow, using Erlang or a batch script, repeatedly initiate my Matlab script using that one instance of Matlab.
Can this be done?
Note, I am using Matlab 7.8.0 (R2009a) on Windows7.
*Extra slow due to issue outlined here!
It is not simple. But you can try using COM automation server interface in MATLAB. You need to have Erlang library for interfacing with COM automation servers. With this interface you can create an automation server and then keep sending commands to it. The documentation is available at http://www.mathworks.com/help/matlab/call-matlab-com-automation-server.html. In the documentation there are examples which use Visual Basic code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With