1

I need to connect to Matlab from Java using matlabcontrol.

I tried their demos and those are working fine but when I tried to connect to Matlab using my application in Java RCP e4 I get this error (to be clear, my code succeeds in opening an instance of Matlab but afterwards the following appears in the Matlab window):

??? Undefined variable "matlabcontrol" or class "matlabcontrol.MatlabClassLoaderHelper.configureClassLoading".

And this appears in the eclipse server window:

matlabcontrol.MatlabConnectionException: MATLAB proxy could not be created in 180000 milliseconds

I tried searching for the answer and this came up: http://code.google.com/p/matlabcontrol/wiki/Compatibility

They say here that if this error comes, to run this command in Matab: java.lang.System.getProperty('java.class.version')

And if the answer is 50 or greater then matlabcontrol should work, but it doesn't for me.

I can't understand what's wrong (demo works, my code doesn't) and I'm desperately in need of an answer. This is for a project due soon and I would appreciate all the help I can get.

1 Answers1

1

I faced a similar problem. This is what I did to solve the problem.

Go to the properties of your project in Eclipse. You can do this by selecting your project in "Package Explorer" and pressing Alt+Enter or by simply selecting properties on right click context menu.

In properties window, select "Java Compiler" and uncheck "Use compliance from execution.... 'JavaSE-1.8' on....". After that select "1.7" from drop down menu in "Compiler compliance level"

I hope this solves the problem for you!