Need To call ODE45 from java, it shows an error "Could not convert Java argument of type "com.mathw​orks.engin​e.FutureRe​sult" 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 个)

类别

Help CenterFile Exchange 中查找有关 Call MATLAB from Java 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by