如何从java中调用Matlab# Java - 爪哇娇娃
r*u
1 楼
以下程序用javac JavaMatlab.java 可以通过编译.
但是java JavaMatlab运行却出错:
Exception in thread "main" java.lang.NoClassDefFoundError:
com/mathworks/mwt/mesage/MWHandler
大伙说说.
//calling matlab from Java.
import com.mathworks.jmi.*;
public class JavaMatlab{
public static void main (String[] args)
{
String x1="pwd";
try
{
Matlab m = new Matlab();
m.eval(x1);
}
catch (Exception e)
{
System.out.println("error");
}
}
}
但是java JavaMatlab运行却出错:
Exception in thread "main" java.lang.NoClassDefFoundError:
com/mathworks/mwt/mesage/MWHandler
大伙说说.
//calling matlab from Java.
import com.mathworks.jmi.*;
public class JavaMatlab{
public static void main (String[] args)
{
String x1="pwd";
try
{
Matlab m = new Matlab();
m.eval(x1);
}
catch (Exception e)
{
System.out.println("error");
}
}
}