Code covered by the BSD License  

Highlights from
progbar

4.64286

4.6 | 14 ratings Rate this file 9 Downloads (last 30 days) File Size: 6.86 KB File ID: #869
image thumbnail

progbar

by Ben Mitch

 

04 Oct 2001 (Updated 13 May 2010)

progbar.m: general purpose progress bar for MATLAB

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

This is a script based progress bar for MATLAB, simple usage is very simple, more complex usage is available. multiple instances no problem.

NOTE: special consideration has been given to not slowing down your hyper-optimised loops, so you should find this better than the sort of progress bar you get for free in a box of cereal.

NOTE: updated 12/05/2010 to be even better (twice as good) at not slowing down your loops. i think i really need to get a life.

typical usage:
--------------
info.color='red';
info.title='hard work';
p=progbar(info);
for n=1:1000
  % do hard work here...
  progbar(p,n/1000*100);
end
progbar(p,-1);

Acknowledgements
This submission has inspired the following:
progressbar
MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (14)
14 Jan 2002 Marc Schurr  
02 Feb 2002 Yuval Cohen

Did not work properly under Matlab 6.0 and Windows XP
To fix the problem, replace lines 122-127 with:

handle=figure(...
'MenuBar','none',...
'resize','on',...
'numbertitle','off',...
'userdata',info,...
'name',info.title);
set(handle,'Resize','off');

29 Nov 2002 Edo Becker

very nice tool, needs modification for windows 2000 and Matlab 6.1

21 Jan 2003 Chris St. Jean

Worked perfectly without modification. Thanks!

30 Jan 2003 Philippe Lagueux

Worked perfectly and easily. However, does not recognize color codes such as 'r' (red==>[1 0 0]) with version 6.5 R13

18 Apr 2003 Uri Perets

Exelent tool, easy for use. Just one problem, in R13 it don't recongnise color codes.

12 Aug 2003 altug bicak

great work

14 Nov 2003 James Goodwin

Great tool. Useful for long calculations where your not sure how far matlab has got!

02 Feb 2004 Rajeev Madazhy

good tool....

05 Feb 2004 Rialland Stephane

Simple use and excellent.

08 Mar 2006 Pedro Antoranz

Very useful and easy to call

12 Jul 2007 Nate Hough

beautiful, works like a charm. simple but useful.

17 May 2010 Matthew

beautiful

18 Nov 2010 w sq

I have a qustion about progress bar. I wanna read a file and display a time-consum progress bar under it, but i cann't estimate how much time it used. So how do you know the percentage?

Please login to add a comment or rating.
Updates
07 Jun 2002

Fixed XP issue. Now works properly under XP/v6.

22 Sep 2003

Some people complained that progbar doesn't recognise colour codes. Well, it's not supposed to, unless you have the colour tool "rgb.m" on your path as well (see the help). This update simply adds "rgb.m".

12 May 2010

Improved performance (twice as fast) in tight loops (inspired by comments from Bob Bemis).

13 May 2010

slight appearance upgrade

Tag Activity for this File
Tag Applied By Date/Time
gui tools Ben Mitch 22 Oct 2008 06:38:14
example Ben Mitch 22 Oct 2008 06:38:14
progress bar Ben Mitch 22 Oct 2008 06:38:14
gui Ben Mitch 22 Oct 2008 06:38:14
examples Ben Mitch 22 Oct 2008 06:38:14
utilities Ben Mitch 22 Oct 2008 06:38:14
potw Shari Freedman 12 May 2010 10:01:05
waitbar Robert Bemis 18 Jun 2010 12:27:22
pick of the week Jiro Doke 11 Feb 2011 20:06:49

Contact us at files@mathworks.com