Progress bar (cli, gui, parfor)

Handy progress bar that can be used in GUI or text interface with parfor compatibility.

https://github.com/elgar328/matlab-code-examples/tree/main/tools/ProgressBar

You are now following this Submission

Handy progress bar that can be used in GUI or text interface.
  • Faster than waitbar (MATLAB builtin)
  • GUI interface
  • Figure automatically closes when the task is complete
  • CLI interface
  • Monospaced fonts are recommended for the CLI interface
  • Parfor compatibility
  • It uses parallel.pool.DataQueue
  • No file I/O, no java class, no undocumented matlab for parallel progress tracking
  • Support for legacy MATLAB releases
  • Standard version: MATLAB 2020b ~ latest
  • Legacy-compatible version: MATLAB 2017a ~ latest
Simple usage
Task name, Parfor
Text based progress bar
Faster than waitbar (MATLAB builtin)
N = 500000;
WB = waitbar(0,'waitbar'); % waitbar (MATLAB builtin)
for n = 1:N, waitbar(n/N,WB); end
close(WB)
PB = ProgressBar(N); % ProgressBar gui
for n = 1:N, PB.count; end
PB = ProgressBar(N, ui='cli'); % ProgressBar cli
for n = 1:N, PB.count; end
Elapsed time @ 2021 MacBook Pro 14" (M1 Pro)
  • waitbar (MATLAB builtin) : 129.17 sec
  • ProgressBar gui : 20.26 sec
  • ProgressBar cli : 18.30 sec

Cite As

HyunGwang Cho (2026). Progress bar (cli, gui, parfor) (https://in.mathworks.com/matlabcentral/fileexchange/121363-progress-bar-cli-gui-parfor), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with R2017a and later releases

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.3.1

Taskname can be of string type

1.3.0

The no_log option was added.
The syntax of the function has been changed.

1.2.9

Fixed: Inaccurate remaining time

1.2.8

Legacy-compatible version (MATLAB 2017a ~ latest) added

1.2.7

Fixed an error that occurred when there is no parallel computing toolbox.

1.2.6

Fixed bugs in versions prior to R2021a

before
contains(addon_list.Name, "parallel computing toolbox",IgnoreCase=true)
after
contains(addon_list.Name, "parallel computing toolbox",'IgnoreCase',true)

1.2.5

Fixed instability when there is no parallel toolbox.

1.2.4

Error with no parallel toolbox is resolved

1.2.3

Error with no parallel toolbox is resolved

1.2.2

ratio_resol = 0.01;

1.2.1

Performance improvement at non-parfor

1.2.0

Integration of 4 types of progressbar into one.

1.1.2

Edited description.

1.1.1

Main image changed

1.1.0

Extended to 4 types of progress bar

1.0.0