MATLAB: MATLAB runtime

functioruntime

I am running a matlab function that requires processing a huge number of data that can take hours or even days. Is there a way for us to check the progress of our matlab function, i.e. the approximate time it will require MATLAB to finish computing the function?
Thanks!

Best Answer

You would have to change the program itself to display its own progress. You can do this very simply with DISP, or you could use the progress bar shown by WAITBAR. Your function should be able to work out roughly how far through it is by counting iterations of its main loop.
It makes sense to save the state of your computation periodically, using the SAVE function. Call this every N iterations of the main loop, where you choose N to make a reasonable interval. You should probably save to a sequence of files, or at least to two files alternately, to protect against the computer going down during a save. You need to ensure that SAVE has access to all the variables that you need to save in order to restart the computation. Then, if you need to restart the computation, you can use LOAD to restore the latest state that was saved.