I have a MATLAB script running on a Java Eclipse project via the matlabcontrol.jar package.
I have the following set-up
MatlabProxyFactoryOptions options = new MatlabProxyFactoryOptions.Builder()
.setUsePreviouslyControlledSession(true)
.setHidden(true)
.setMatlabLocation(null).build();
MatlabProxyFactory factory = new MatlabProxyFactory(options);
MatlabProxy proxy = factory.getProxy();
//some code invoking the proxy.eval() method
The problem is that I have the MATLAB script running several times over the course of the runtime of the simulation. How can I make it so that Java doesn't have to reconnect with MATLAB every single time I want to use the MATLAB function?
Any help would be appreciated.
Thanks!