Like the Mathworks waitbar but better! Very useful for loops in which each iteration takes a long time. There are solutions for loops with quick iterations so the above critique is somewhat harsh.
Great tool! The only prob I had was dealing with zero progress. My solution is:
% 2.2 - Calculate the estimated time remaining
e_mes = datestr(elap/86400,'HH:MM:SS');
if progress~=0
sec_remain = elap*(1/progress-1);
r_mes = datestr(sec_remain/86400,'HH:MM:SS');
else
r_mes = ('--:--:--');
end
Not sure why I had the prob only after a fresh start of Matlab though...
Ross, i don't want to argue much on this, i see your point.
I mean you have a point if the computation is heavy due to what's inside the loop, but not when is due to the high number of iterations.
In response to the time comparison:
Updating the graphical progress display is certainly going to take longer than an addition operation like k=k+1, but will be negligible when compared to a computationally heavy process, and can be read from across the room.
Comment only