No BSD License  

Highlights from
Fast Progress Display

3.0

3.0 | 2 ratings Rate this file 2 Downloads (last 30 days) File Size: 2.14 KB File ID: #6891
image thumbnail

Fast Progress Display

by Harold Vanicek

 

09 Feb 2005 (Updated 17 Feb 2005)

The fastest way to show a progress bar is to do it without a gui...this does just that.

| Watch this File

File Information
Description

GETPCT.M is a function that will allow the user to monitor the progress of their job, without the overhead created with waitbar and other gui type progress bars. It simply will go through 10 20 30 40 50 60 70 80 90..done! on the command line, saving time and still showing you where the process is at.

There are some IF statements in this .m file, but it is a compromise. I could just use an fprintf to the line to be the fastest, but I didn't want multiple 10's or 20's..etc. to show up on the screen...just one of each. So, I created a "block" array that noted when each percent number was used and didn't use it again. This method is clean and still much faster than the gui progress bar.

MATLAB release MATLAB 7.0.1 (R14SP1)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
15 Feb 2005 Jérôme Never Give my Real Name

How to say ?

Why not simply :

for i=1:1000

% Insert your code

fprintf([num2str(floor(100*i/1000)) ' %%\n'])

end

On my PC :
your example : 15 s
  my example : 0.5 s

(That's without any processing code !)

How could you hope saving time with so much "if" conditions in your code ?

Jérôme

17 Feb 2005 Jérôme Never Give my Real Name

Exchanging some e-mail with the author I decided to change my rating from 1 to 5.
Not because I appreciate the code produce here. But I misunderstood it's utility.

So my current rating would be 3

The rating I posted before is more related to the difficulty to include this code into others.

Waiting for next version of getpct.m

Jérôme

Please login to add a comment or rating.
Updates
17 Feb 2005

I am updating this file to explain the reasoning for some of the code.

Tag Activity for this File
Tag Applied By Date/Time
data import Harold Vanicek 22 Oct 2008 07:41:02
data export Harold Vanicek 22 Oct 2008 07:41:02
waitbar Harold Vanicek 22 Oct 2008 07:41:02
progress Harold Vanicek 22 Oct 2008 07:41:02
percentage Harold Vanicek 22 Oct 2008 07:41:02
pct Harold Vanicek 22 Oct 2008 07:41:02
utilities Harold Vanicek 22 Oct 2008 07:41:02
data Harold Vanicek 22 Oct 2008 07:41:02

Contact us at files@mathworks.com