No BSD License  

Highlights from
WORKBAR

4.84615

4.8 | 13 ratings Rate this file 21 Downloads (last 30 days) File Size: 108.66 KB File ID: #7109
image thumbnail

WORKBAR

by Daniel Claxton

 

11 Mar 2005 (Updated 22 Mar 2005)

Efficient and stylish alternative to WAITBAR.

| Watch this File

File Information
Description

WORKBAR Graphically monitors progress of calculations
    WORKBAR(X) creates and displays the workbar with the fractional length
    "X". It is an alternative to the built-in matlab function WAITBAR,
    Featuring:
        - Doesn't slow down calculations
        - Stylish progress look
        - Requires only a single line of code
        - Displays time remaining
        - Display time complete
        - Capable of title and description
        - Only one workbar can exist (avoids clutter)
 
    WORKBAR(X, MESSAGE) sets the fractional length of the workbar as well as
    setting a message in the workbar window.
 
    WORKBAR(X, MESSAGE, TITLE) sets the fractional length of the workbar,
    message and title of the workbar window.
 
    WORKBAR is typically used inside a FOR loop that performs a lengthy
    computation. A sample usage is shown below:
  
    for i = 1:10000
        % Calculation
        workbar(i/10000,'Performing Calclations...','Progress')
    end
 
    Another example:
 
    for i = 1:10000
          % Calculation
          if i < 2000,
               workbar(i/10000,'Performing Calclations (Step 1)...','Step 1')
          elseif i < 4000
               workbar(i/10000,'Performing Calclations (Step 2)...','Step 2')
   elseif i < 6000
               workbar(i/10000,'Performing Calclations (Step 3)...','Step 3')
          elseif i < 8000
               workbar(i/10000,'Performing Calclations (Step 4)...','Step 4')
          else
               workbar(i/10000,'Performing Calclations (Step 5)...','Step 5')
          end
      end
 
  See also: WAITBAR, TIMEBAR, PROGRESSBAR

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
timebar, progressbar
This submission has inspired the following:
embededprogressbar

MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (13)
14 Mar 2005 Igor Moiseev

Thank you for useful tool.

28 Apr 2005 Jay Cee

This is very cool - thanks!

03 Jun 2005 ben mitch

much better than my old thing (progbar). couple of issues...

1) in v7 i have my default window style set to docked, so the progress bar gets docked, which looks wrong and is less functional. add line 122

'WindowStyle','normal',...

and 2) you have not turned off handle vis. so i can plot to this figure, which is a shame. i find if i add this at figure creation things get a bit messed up so my quick hack was to add line 191...

set(progfig,'HandleVisibility','off');

which seems to work. you might want to check that though.

nice job. love the XP styling. bet those UNIXers hate hate hate it. :)

16 Jun 2005 Matthias Althoff  
03 Aug 2005 Rafy Azman

Very cool!!

14 Nov 2005 Chanin Kawaokaw

It's Works

01 Dec 2005 Jan Huisken

Great! I think this is the best of all! Gives you: time remaining, percentage, and title!

25 Apr 2006 Mike Russell

With R2006a I do not have 'imshow' available. I am trying to determine why so I can use your progress bar.

Also a fantastic option would be the addition or ability to have a cancel button similar to waitbar.

04 Jun 2006 ebrahim sepidbar

workbar

09 Oct 2008 Simon Robinson

colour match XP scheme. It would be nice to have an Ubuntu theme too.

11 Mar 2009 Namshik Han  
02 Jul 2009 andrey

preventing waitbar from slowing down your calculation:
for i =1:50000
        if ((i/100) == floor(i/100))
            waitbar(i/all.data.num_of_mol);
        end
end

31 Mar 2011 Arturo Moncada Torres  
Please login to add a comment or rating.
Updates
15 Mar 2005

Corrected a few minor bugs

18 Mar 2005

Fixed bug with x = 0

22 Mar 2005

It's more better

Tag Activity for this File
Tag Applied By Date/Time
gui tools Daniel Claxton 22 Oct 2008 07:43:03
example Daniel Claxton 22 Oct 2008 07:43:03
waitbar Daniel Claxton 22 Oct 2008 07:43:03
progress Daniel Claxton 22 Oct 2008 07:43:03
progressbar Daniel Claxton 22 Oct 2008 07:43:03
timebar Daniel Claxton 22 Oct 2008 07:43:03
workbar Daniel Claxton 22 Oct 2008 07:43:03

Contact us at files@mathworks.com