Progress of calculation

14 views (last 30 days)
john on 16 Jun 2012
Hi, if I press pushbutton, then I calculate matrix "result" like
matrix =[A B C D; E F G H, I J K L];
Is possible to show progress of this calculation? Progress begin, if I press the button and stop if calculation is stop. I found this code, but it's not what I realy need because bar is independent on the calculation.
h = waitbar(0,'Please wait...');
steps = 1000;
for step = 1:steps
% computations take place here
waitbar(step / steps)
Time of calculation is not the same, it is variable.

Accepted Answer

Walter Roberson
Walter Roberson on 16 Jun 2012
If you do not have any information about how long the calculation "should" take, and you do not have access to the source to put in hooks to update progress information based upon internal knowledge of how far the algorithm has gotten, then NO, you cannot create any kind of progress bar.
You can create visual feedback that the computation is not yet finished (a "spinner" or "hourglass"), but without one of the two pieces of information I mention above, you cannot know how far it has gotten or whether it will finish at all.
Walter Roberson
Walter Roberson on 18 Jun 2012
After the set(), call drawnow()

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!