Method call order
Hello everyone I am writing a java class with a main method and I am calling a method from matlab which takes a long time and the program runs another method which takes less time before the matlab method. I want to run a method from matlab to execute first, then I want another method to execute, so you can help me.
thanks
Sounds like you need threads. You can find the Sun concurrency tutorial .
Basically, you can do something like this:
public static void main(String[] args) {
Runnable r = new Runnable() {
public void run() {
doMethod();
doOtherMethod();
}
}
new Thread(r).start();
doAnotherMethod();
a source to share
I think you want to use Matlab's Thread join () method to wait for the thread to end before moving on to another method.
I'm not sure if this means what you mean by "method from Matlab to execute first, then I want another method to execute".
I just do not know. The question is interesting, but why did you not provide the code that you use to call the matlab method, as you say: "I am calling the method from Matlab". Perhaps if you showed how?
a source to share