Code covered by the BSD License  

Highlights from
txtprogressbar

Be the first to rate this file! 8 Downloads (last 30 days) File Size: 2.1 KB File ID: #15030

txtprogressbar

by

 

17 May 2007 (Updated )

show simulation progress and remaining time as text

| Watch this File

File Information
Description

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

Acknowledgements

Progressbar inspired this file.

This file inspired Autoscaleit.

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
12 Dec 2013 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

Contact us