Need To call ODE45 from java, it shows an error "Could not convert Java argument of type "com.mathworks.engine.FutureResult" to MATLAB type"
Show older comments
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);
}
}
Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!