Need To call ODE45 from java, it shows an error "Could not convert Java argument of type "com.mathworks.engine.FutureResult" to MATLAB type"
1 次查看(过去 30 天)
显示 更早的评论
import com.mathworks.engine.*;
public class Main{
public static void main(String[] args) throws Exception{
double startTime = System.currentTimeMillis();
// for (int x = 1; x < 10; x++) {
ODE ode = new ODE ();
MatlabEngine eng = MatlabEngine.startMatlab();
double [] time = {0, 10};
Future<Object> a = eng.fevalAsync("ode45", ode.getEquation(0.3, 0.4), time, 10);
eng.close();
// }
double endTime = System.currentTimeMillis();
double searchTime = endTime - startTime;
System.out.println("Computational time " + searchTime);
}
}
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Call MATLAB from Java 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!