From: Roy van den Berg on
I am trying to use a Java class in Matlab 6.5, but Matlab couldn't find it.
I tried the solution proposed in http://www.mathworks.com/support/solutions/en/data/1-1NEETO/index.html?product=ML&solution=1-1NEETO but this didn't work out.

I've added the next line to classpath.txt:
C:\localdata\eclipse workspace\experimentconfiguration\bin

Matlab fails when executing the next line:
experiment = testsuite.TSReader.getExperiment(...)
I receive the error message:
??? Undefined variable 'testsuite' or class 'testsuite.TSReader.getExperiment'.

I've tried the same on another computer running Matlab 7.8.0 (R2009a) with
addclasspath 'C:\localdata\eclipse workspace\experimentconfiguration\bin'
instead of adding a line to classpath.txt and this works.

Can anyone tell me what I'm doing wrong?
From: Yair Altman on
"Roy van den Berg" <rjjvandenberg(a)gmail.com> wrote in message <hsrsu4$efl$1(a)fred.mathworks.com>...
> I am trying to use a Java class in Matlab 6.5, but Matlab couldn't find it.
> I tried the solution proposed in http://www.mathworks.com/support/solutions/en/data/1-1NEETO/index.html?product=ML&solution=1-1NEETO but this didn't work out.
>
> I've added the next line to classpath.txt:
> C:\localdata\eclipse workspace\experimentconfiguration\bin
>
> Matlab fails when executing the next line:
> experiment = testsuite.TSReader.getExperiment(...)
> I receive the error message:
> ??? Undefined variable 'testsuite' or class 'testsuite.TSReader.getExperiment'.
>
> I've tried the same on another computer running Matlab 7.8.0 (R2009a) with
> addclasspath 'C:\localdata\eclipse workspace\experimentconfiguration\bin'
> instead of adding a line to classpath.txt and this works.
>
> Can anyone tell me what I'm doing wrong?

One possibility is that your testsuite package uses (imports) classes or JAR files that are missing from your Matlab 6.5 Java classpath (type javaclasspath in your Matlab prompt to check), but which are present in your R2009a environment. Unfortunately, the Matlab classloader issues a very misleading generic error message in such a case. As far as I know, this has not been reported on CSSM or elsewhere until now. I'll report this as a bug in a moment.

Please note that I am not saying this is definitely the cause of your problem - only that this is a potential cause that would explain the symptoms you've reported. If I'm correct, the simple solution is to simply add the dependent classes and JARs using the javaaddpath function, or to add them to classpath.txt.

Yair Altman
http://UndocumentedMatlab.com
From: Roy van den Berg on
Thanks for your response. I'll find a way to work around this problem. Many ways lead to Rome...