Get from Ico-github-logo

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

» Watch video

Highlights from

  • ParforProgressStarter2(s,...
    Starter function for parfor progress-monitor, that will automatically
  • ParforProgressStressTest2...
    Stress test for 'ParforProgressStarter2'. In case of timeouts, you can
  • get_matlab_version()
  • pool_size()
    POOL_SIZE - temporary hack to return size of current MATLABPOOL / PARPOOL
  • print_error_red(msg, tab_...
    show error in red
  • ParforProgress2
  • ParforProgressConsole2
    do NOT use this object by itself!
  • View all files
4.8 | 14 ratings Rate this file 5 Downloads (last 30 days) File Size: 272 KB File ID: #35609 Version: 1.16
image thumbnail



Andreas (view profile)


13 Mar 2012 (Updated )

A PARFOR progress monitor for Matlab GUIs and the command line (works with normal for-loops)

| Watch this File

File Information

This progress monitor comes with a nice wrapper `ParforProgressStarter2.m` which will take care of adding the classes to the java class path, depending on whether matlabpool is enabled or not.
For instructions on how to use with global variables, please see
You can fork the code @

Required Products MATLAB
MATLAB release MATLAB 7.6 (R2008a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (21)
16 Sep 2016 Mehmet Seker

is it possible to convert your gui into like this?
ETA: elapsed time
RTA: remaining time

06 Jan 2016 Elizabeth Jones

13 Nov 2015 Seyedfarid Ghahari

Thank you for your great code. I have a slider on my GUI. How can I use your code to update the slider progress in parfor loop?

Comment only
09 Jun 2015 mauricio castaño

16 Mar 2015 Eduard

Eduard (view profile)

27 Oct 2014 Elizabeth Jones

I have been using your parfor progress bar for a couple of years, and it's been working great. I recently upgraded from R2012b to R2014b, and I was so glad to see that you had already updated the progress bar! It made switching all my code to the newest version of Matlab so much easier. Thanks!

28 Jul 2014 Rudi

Rudi (view profile)

Andreas, thanks for the update, seems to work. I now have another more difficult question: do you have any idea how I might use your code, or something similar, within a mexed parfor loop (mexed to C++ with OpenMP)? I tried using coder.extrinsic for your functions, but apparently calls to extrinsic functions inside mexed parfor loops are unsupported...

Comment only
09 Jul 2014 Andreas

Andreas (view profile)

@Rudi: please use version 0.2.7 with Matlab 2014a.

Comment only
27 Jun 2014 Rudi

Rudi (view profile)

I have used this great tool for some time but it appears to not work in 2014a with the following error. Works on same exact code in 2013b. Please update, this is the nicest parfor progress meter I have found!

Warning: While loading an object of class 'ParforProgress2': Undefined variable "ParforProgressClient2" or class "ParforProgressClient2.createClient".
Warning: The following error was caught while executing 'ParforProgress2' class destructor:
Attempt to reference field of non-structure array.
Error using ParforProgress2/increment (line 121)
Attempt to reference field of non-structure array.

Comment only
03 Jun 2014 Hassan Naseri

03 Jun 2014 Hassan Naseri

Nice tool. But it clears my global variables !!

28 Jan 2014 Christophe Trefois

18 Nov 2013 Jerome

Jerome (view profile)

@Andreas: Thanks for looking into this.
Are you sure it does not clear globals?
I see that you added a "server_class_loaded" boolean to make sure that javaaddpath is only called once but I discovered the clear global was due to the first call to javaaddpath.
Since you need to do that call, it seems like global will be cleared then, correct?

Comment only
24 Oct 2013 Andreas

Andreas (view profile)

@Jerome: please try the v0.2 release, which should appear shortly here and is also available on github:

Comment only
23 Oct 2013 Jerome

Jerome (view profile)

Do you have any idea why this clear all global variables?
Without this waitbar my globals stay fine.

28 Aug 2013 Adam

Adam (view profile)

Does anyone know why this progress monitor would conflict with the Matlab 2013 unit testing framework? I have a test covering a function that uses it - when I create the test instance on its own I can run it fine. When I run it within a test suite though it appears to run fine first time, but then if I run the tests a second time I get a segmentation dump when it tries to build the test suite (this does not happen if I remove the progress monitor). It also seems to work fine when used with the older xUnit framework from Matlab Central.

I like it in general though.

09 Apr 2013 Jens

Jens (view profile)

20 Dec 2012 Bart Boesman

Thanks for this file, works perfect!



16 Oct 2012 Eduard

Eduard (view profile)

FYI, I did the changes to ParforProgress2 myself and it actually works perfectly.

Only pit I fell into was compiling the Java code with JDK 7 instead of JDK 6 first, therefore not beeing compatible to MATLAB R20012a's integrated JRE 6.

Comment only
15 Oct 2012 Eduard

Eduard (view profile)

Hi Andreas,

two questions:

1 - Could you add a possibility to "break" the parfor-loop from within ParforProgress2? I was thinking about something quite simple like polling for the existence of a file at the start of the parfor-loop and just "continue" when it exists. The file could be created by ParforProgress2 as soon as the progress window is closed replacing the current warning message (or even add a cancel-button to it).
Probably you can come up with an even better solution yourself!

2 - It would be nice if the output "execution time was XXXs." would only be displayed if do_debug=1, so bascally no output at all is produced when do_debug=0.


02 Oct 2012 Matt Smith

13 Mar 2012 1.1

more detailed description of program added.

24 Mar 2012 1.3

added missing functions.

24 Mar 2012 1.4

rewrite awt and java checks in 'ParforProgressStarter2'
basic support for non-GUI output in '':
 - works fine if matlabpool == 0
 - no output if matlabpool == 1

03 Apr 2012 1.5

show runtime & eta in console non-worker mode.
little fixes & improvements.

03 Apr 2012 1.6

ETA & running time update now works with parfor loops on the console.

18 Mar 2013 1.7

updated version fixes matlab 2013a problem.

24 Oct 2013 1.8

v0.2 Does not clear global variables anymore.

14 Nov 2013 1.10

Updated docs to reflect replacement of 'matlabpool' by 'parpool' in R2013b.

14 Jan 2014 1.12

added workaround and instructions for use with global variables. See

05 Feb 2014 1.13

documentation update regarding usage of global variables.

09 Jul 2014 1.15

Version 0.2.7 fixes problems with Matlab 2014a.

18 Aug 2015 1.14

registered download link with GitHub

20 Aug 2015 1.16

Version 0.2.8 gives the user the option enable / disable the display of the execution time.

Contact us