3.8

3.8 | 7 ratings Rate this file 10 Downloads (last 30 days) File Size: 1.39 KB File ID: #1436

wdisp: a pedestrian command window waitbar

by

 

28 Feb 2002 (Updated )

Creates a waitbar-like display in the command window.

| Watch this File

File Information
Description

Creates the equivalent of WAITBAR in the command window.
See:
help wdisp
for a self-explanatory example - or type:

  t='-\|/';
  for i=1:40
  tl=wdisp( 0,sprintf('time %c %s',t(rem(i,4)+1),datestr(now)));
% do some computation(s)
  tl=wdisp(tl,sprintf('count %3d %s',i,repmat('.',1,i)));
% do more computation(s)
  pause(.1);
  tl=wdisp(tl);
  end

MATLAB release MATLAB 5.2 (R10)
Other requirements tested on w2k.sp2/wxp.sp1
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (10)
08 Mar 2013 Vicente Reyes-Puerta

Hi,
I just thought of a small tweak in the code. By using the fprintf() function instead of disp(), it is possible to avoid the flickering of the command window when it already has a scrollbar (which is actually irritating).

Here the body of the modified function:

if ~nargin & ~nargout
help wdisp;
elseif nargin == 1
fprintf(repmat(char(8),1,par));
par=0;
elseif nargin == 2
fprintf(str);
par=par+length(str);
else
par=0;
end

And here a small example to use the modified version of wdisp():

t='-\|/';
tl=wdisp( 0,num2str(0));
for i=1:40
tl=wdisp(tl);
tl=wdisp(tl,sprintf('count %3d %s',i,repmat('.',1,i)));
pause(.1);
end
disp(' ');

Hope this helps someone :)
Vicente

14 Apr 2008 Burra Burra

Shame on me!

14 Mar 2008 Burra Burra

Sorry for the previous, wrong rating

14 Mar 2008 Burra Burra

1000 downloads to recover 5th place

19 Jan 2008 I will resist

150 dl saterday night mode?

07 Dec 2007 The Boss  
06 Dec 2007 Swathi krishna Burra

After click of matlab 7.0.(R14) icon command window displays after appearance of command prompt window closes automatically.I tried after reinstall of my operating system and matlab problem repeats the same?I cannot do my work due to this trouble ?please solve my problem

24 Nov 2007 Chi Chi

UAU, > 500 downloads in less than a second. ?????????????????

29 Jun 2007 zeus matlab heavens

Mrs. Klaublauer, this program is working perfectly for the rest of the world! What you are experiencing is a problem of your operating system. Please refrain from rating submissions just because you are frustrated - and please, add a valid email address to your review so the author can get in touch with you.

26 Jun 2007 Lava Klaublauer

Matlab R12 displays boxes for char(8) instead of doing a backspace, breaking this. I don't know of any solution.

Updates
15 Apr 2002

add <help> entry:
input must be a STRING

15 Apr 2002

corrected incomplete update

09 Dec 2002

slightly changed example in <description>

Contact us