4.8

4.8 | 21 ratings Rate this file 85 downloads (last 30 days) File Size: 4.18 KB File ID: #6922

progressbar

by Steve Hoelzer

 

15 Feb 2005 (Updated 16 Feb 2005)

Code covered by BSD License  

Simple, efficient, and user friendly replacement for waitbar.

Download Now | Watch this File

File Information
Description

This implementation of progressbar is intended to be extremely simple to use while providing a high quality user experience.

Features:
  - Can add progressbar to existing m-files with a single line of code.
  - The figure closes automatically when the task is complete.
  - Only one progressbar can exist so old figures don't clutter the desktop.
  - Remaining time estimate is accurate even if the figure gets closed.
  - Minimal execution time. Won't slow down code.
  - Random color and position options. When a programmer gets bored....

Demo:
  n = 1000;
  progressbar % Create figure and set starting time
  for i = 1:n
      pause(0.01) % Do something important
      progressbar(i/n) % Update figure
  end

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
progbar
This submission has inspired the following:
txtprogressbar, WORKBAR, Movie Editor

MATLAB release MATLAB 6.0 (R12)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (22)
16 Feb 2005 Alan Brooks

Very simple to use and very efficient. I like the ability to use it in one line of code.

17 Feb 2005 jiro d

very slick!

22 Feb 2005 Antoni Josep Canós Marín

Very good!!. It should be included in future releases of MATLAB.

11 Mar 2005 Tim Faughn

Fantastic!

05 Apr 2005 Ryan Scheppele

Nifty little routine!

15 Jun 2005 Fred Plourde

Very simple and yet, very efficient ! It took me less than 2 minutes to add it successfully to my project

19 Aug 2005 Jean-Vincent LE LAN  
15 Sep 2005 Michal Mackiewicz  
27 Sep 2005 Wolfgang Garn

An interesting extension would be to start more than one progressbars.

06 Oct 2005 Liz Leibman

Thank you! Its just perfect! Now my program looks so good!

11 Nov 2005 Wolfgang Garn

It is really terrific. Thank you.
If you like to have two, three or more progressbars, just copy the m-file to progressbar2, progressbar3, ...

06 Dec 2005 Bharat Rangan

Great work. Very useful little piece. A possible addition is the ability to add another string during inititation which could specify the task at hand. Just my 0.02. Thanks a ton

05 Jan 2006 Suhas Gajre

One of the beautiful codes I have seen!

Very much useful for programmers like me who have to wait for agonizingly long time to finish the code :))

11 Feb 2006 Tom Nagel

I love it. So easy, so helpful.

27 Apr 2006 Dave Douglas

This thing is simple to use and looks fantastic. Thanks!!!

02 Jul 2006 Luis Aponte

This function is great and very simple to use.

07 Aug 2006 Quintin Coetzee

Thak you for this substitute for waitbar.
I will be using it in software I am developing for my 4th year engineering report.

23 Mar 2007 A L P

Have problem with this function and plotting graph.
This is the error that appear:
>??? Invalid handle object.
>
>Error in ==> progressbar at 202
>set(progpatch,'XData',[0 fractiondone >fractiondone 0])
>
>Error in ==> Untitled at 17
> progressbar(inc/nbpt)

13 Dec 2007 Quan Quach

I made some modifications to this great app and you can find it here. Added an abort functionality and an output parameter so that when the progress bar is closed, you can use the output parameter to break from the for loop.

http://www.blinkdagger.com/matlab/matlab-gui-tutorial-progress-status-bar

19 Apr 2008 Abel Brown

lol, so simple and nice. makes ppl think you're awesome at matlab when they see a progbar :)

like this much better than waitbar!!! Nice work

25 Jun 2008 Khaledov Kh

Needs to name the process bar...

27 Aug 2008 jongchul kim

slsls

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
gui tools Steve Hoelzer 22 Oct 2008 07:41:12
example Steve Hoelzer 22 Oct 2008 07:41:12
progress Steve Hoelzer 22 Oct 2008 07:41:12
progressbar Steve Hoelzer 22 Oct 2008 07:41:12
wait Steve Hoelzer 22 Oct 2008 07:41:12
indicator Steve Hoelzer 22 Oct 2008 07:41:12
bar Steve Hoelzer 22 Oct 2008 07:41:12
time Steve Hoelzer 22 Oct 2008 07:41:12
waitbar Steve Hoelzer 22 Oct 2008 07:41:12
progress bar Steve Hoelzer 25 Mar 2009 14:16:13
progressbar Merve 11 Aug 2009 11:40:51
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com