0

I've made a web service using Java 7 and Matlabcontrol-4.1.0. In this web service, i'm starting a Matlab r2015a session to execute a function. As far as I can see, isExistingSession and setUsePreviouslyControlledSession are functions to use a previously created session.

Q: In order to get the best performance, which method should I use?

isExistingSession (MatlabProxy) and/or setUsePreviouslyControlledSession (MatlabProxyFactoryOptions)?

I am using the following code at the moment:

    // setting up connection to MatLab
    MatlabProxyFactoryOptions options = new MatlabProxyFactoryOptions.Builder()
            .setUsePreviouslyControlledSession(true).setHidden(true)
            .setMatlabLocation(null).build();

    MatlabProxyFactory factory = new MatlabProxyFactory(options);
    MatlabProxy proxy = factory.getProxy();

I have checked setUsePreviouslyControlledSession and isExistingSession, but I don't quite understand.

Camelaria
  • 284
  • 6
  • 23

1 Answers1

0

After digging in the documentation, I think i've looked at it the wrong way.

  • setUsePreviouslyControlledSession (MatlabProxyFactoryOptions): sets whether to use a previously started session.

  • isExistingSession (MatlabProxy): Just returns a boolean answering "is there already a session running?".

These methods have different functions, so the comparison was never valid.

Camelaria
  • 284
  • 6
  • 23