Erik: Depends how slow each iteration of your loop is. If each iteration takes a while to run, this won't impact execution time. If each iteration is very fast, it could. You'll have to benchmark for more specifics, I've only used it on slow problems. If necessary, a quick fix to speed this up would be to change the path of parfor_progress.txt to be on a ramdisk.
I develop on Linux and I've never seen this problem. So it's likely that it is not a Linux problem in general, but it's specific to your particular setup. Maybe something to do with the character encoding on your system?
As a test, run this and see what it outputs:
The output should be just aa, because char(8) is a backspace. This is the technique I used in parfor_progress to delete the previous line, so maybe the backspace isn't working on your Linux machine for some reason?
Or does anyone know of a more universally portable way of doing this?
Jeremy: First, thanks for writing this handy script. It is very useful.
I also found display issues in the linux terminal, which Ashin and Alessandro describe. However, I found a solution pretty quickly though I'm not an expert user of MATLAB at all.
I changed only 3 lines, changing all disp() calls to fprintf().
The char(8) trick works for fprintf() as well and is actually better for linux terminals.
Hope it is useful.