f



calling Matlab from Java #7

Hi,
I am trying to acces Matlab functions from Java code. I tried to use Brad 
Phelan's code from
http://xtargets.com/snippets/user/bradphelan/tag/feval
and test class with main:
        public static void main() {
                class CallMatlab extends Thread {
                        public void run() {
                                MatlabFunction<double[]> f = new 
MatlabFunction<double[]>("times");
                                double[] x =   f.execute(10,20);
                                System.out.println(x[0]);
                        }
                }
                CallMatlab c = new CallMatlab();
                c.start();
        }

but when I execute it, f.execute(10,20); returns null and i get 
NullPointerException. To compile  and run it I added jmi.jar, mwt.jar and 
util.jar from Matlab to the classpath.

Does anybody know what can be wrong?

My enviroment
Java 1.5
Matlab 6.5
Win XP

Best regards
mondo 


0
radek2000 (2)
11/26/2006 1:15:15 PM
comp.soft-sys.matlab 211265 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

0 Replies
462 Views

Similar Articles

[PageSpeed] 8

Reply: