File Exchange

image thumbnail

txtprogressbar

version 1.0 (2.1 KB) by

show simulation progress and remaining time as text

1 Download

Updated

View License

This program is a text version of the "progressbar" program written by Steve Hoelzer. I have found this program useful when using Matlab in console mode (under Linux) for long simulations (usually several hours). I use to launch Matlab in the background with the following command:

nohup matlab -nojvm -nosplash -nodesktop < my_program.m &

All text output is directed to nohup.out file, which can be tested periodically with: "tail -f nohup.out". Using "nohup" has also the advantage that Matlab continues to run after the user is logged out.

Usage example of "txtprogressbar":
   n = 1000;
   txtprogressbar % Set starting time
   for i = 1:n
       pause(0.01) % Do something important
       txtprogressbar(i/n) % Update text
   end

Comments and Ratings (1)

kasim tasdemir

Hi,

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: http://www.mathworks.com/matlabcentral/fileexchange/44673

***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
 end
 dispstat('Finished.','keepprev');

***Output:
11:25:37 Begining the process...
11:25:37 Progress 100%
Finished.

All the best

MATLAB Release
MATLAB 7.4 (R2007a)
Acknowledgements

Inspired by: progressbar

Inspired: Autoscaleit

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

» Watch video