2.5

2.5 | 2 ratings Rate this file 1 Download (last 30 days) File Size: 1.79 KB File ID: #23892
image thumbnail

progress bar

by Giuliano Langella

 

24 Apr 2009 (Updated 12 May 2009)

This function print on your command window a handmade progress bar.

| Watch this File

File Information
Description

If you have a time consuming loop, you can measure the time to end with this function. The only thing you have to know is the total number of loops to do.
For instance if you use:
>>for j = 1:10^6
>>statement;
>>progress_bar(j, 10^6);
>>end
you get the same result in screenshot.

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
12 May 2009 Jason Kaeding

Why not use built-in waitbar function?

12 Jan 2010 Rob Campbell

The waitbar can be annoying at times, so I see why this would be a nice function to have. Unfortunately is has to clear the screen to work. Personally, I prefer sticking an fprintf('.') in the loop so that I can see the progress. Simple but effective.

Please login to add a comment or rating.
Updates
12 May 2009

A third optional input parameter is added. it is useful if embedding the progress_bar function within another function in order to visualize for instance its name (e.g. see screenshot).

Tag Activity for this File
Tag Applied By Date/Time
progress Giuliano Langella 24 Apr 2009 14:21:13
bar Giuliano Langella 24 Apr 2009 14:21:13
loop Giuliano Langella 24 Apr 2009 14:21:13
for Giuliano Langella 24 Apr 2009 14:21:13
end Giuliano Langella 24 Apr 2009 14:21:13
time Giuliano Langella 24 Apr 2009 14:21:13

Contact us at files@mathworks.com