My program has run a long time. I began to run it yesterday. Now I cannot see the command window and editor by clicking on them on the task bar. I tried the “switch to” button of the task manager, too.
The program displays some messages on the command window when it is running. This determines the current step of the program.
How can I find out if my program is running correctly? Alternatively, how can I find if it is trapped in an infinite loop or that MATLAB has crashed.
Both of CPU cores are busy. CPU usage is between 50-70 percent, and MATLAB occupies 1,658,044 K of memory.
Matlab has a tendency to crash if left open and running for long periods of time. It has happened to me more times than I can remember. If Matlab is not responsive after a day, then I’ve rarely had success in allowing the code to finish. You will probably need to start your program again.
There are a couple of things I recommend you do when working with long running pieces of code.
First, find a way to save intermediate results. Since my work is generally with iterative numerical algorithms, I save my workspace after a few iterations of my algorithm. Something simple like
temp.mat. That way if Matlab crashes, you can start your work again from your intermediate results.Second, if you don’t need the Matlab GUI, then don’t use it. In your case, open a DOS prompt and run Matlab without the desktop. The command to do so will be something like:
I’m not a Windows user. That command might launch the GUI, but leave it hidden. It doesn’t launch on *NIX systems and this definitely helps in successful evaluation of long running programs. Try it and see if it helps.
Best of luck!