View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

5.0 | 4 ratings Rate this file 7 Downloads (last 30 days) File Size: 5.54 KB File ID: #30297 Version: 1.1
image thumbnail



Evgeny Pr (view profile)


04 Feb 2011 (Updated )

Console progress bar for long-running operations

| Watch this File

File Information

This class creates a console progress bar (status bar) for long-running operations. Visually, it's very similar to the unix command line utilites "pv" and "wget". You can customize the look to your taste.

In addition, it's funny, but it may be useful. Just for fun! :)

Usage example:
% Create Instance
cpb = ConsoleProgressBar();

% Set progress bar parameters
cpb.setLeftMargin(1); % progress bar left margin
cpb.setTopMargin(1); % rows margin

cpb.setLength(40); % progress bar length: [.....]
cpb.setMinimum(0); % minimum value of progress range [min max]
cpb.setMaximum(100); % maximum value of progress range [min max]


for k = 0:100
    userText = sprintf('Progress: [%d/%d]', k, 100);
    cpb.setValue(k); % update progress value
    cpb.setText(userText) % update user text



This file inspired Ecopath Matlab: A Matlab Implementation Of Ecopath.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (5)
16 Feb 2016 Matthew Eicholtz

I haven't decided whether I should really be using this or writing to a log file, but it worked as described and the code is well-written. The demo was quite helpful, too.

12 Dec 2013 kasim tasdemir


I use 'dispstat' function just for this purpose. It can update the previous output which is a missing function of default 'disp'. Very simple to use. It can be downloaded from here:

***Sample usage:
dispstat('','init'); % One time only initialization
dispstat(sprintf('Begining the process...'),'keepthis','timestamp');
for i = 97:100
dispstat(sprintf('Progress %d%%',i),'timestamp');
%doing some heavy stuff here

11:25:37 Begining the process...
11:25:37 Progress 100%

All the best

Comment only
25 Oct 2012 Peter

Peter (view profile)

Quite usefull. And yes, fun :)

23 Apr 2012 Yair Altman

Yair Altman (view profile)

Well documented, well written, clean and tidy code, useful utility.

Nice and simple example of using Matlab's Object-Oriented programming (good separation of public and private properties/methods, for example).

15 Feb 2011 Pi Ting


05 Feb 2011 1.1

- improved performance
- fixed minor bugs

Contact us