Progress bar

Insert the following line to initialise handler for the progress bar:

h = waitbar(0,'Initialising parameters...');

You may calculate the current status through the algorithm for example in a for loop using the loop variable Ci:

for Ci=0:Cstep:time
{

   % calculate run number
   perc = ceil(100*Ci/(time));
   waitbar(perc/100,h,sprintf('%d%% calculation in progress',perc));

   % useful operations
   ...do other stuff...
}

at the end do not forget to delete or the waitbar window will stay there the user closes it:

delete(h);

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2014-02-18 - KonstantinosPapastergiou
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback