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
us (2021). wdisp: a pedestrian command window waitbar (https://www.mathworks.com/matlabcentral/fileexchange/1436-wdisp-a-pedestrian-command-window-waitbar), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
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
Shame on me!
Sorry for the previous, wrong rating
1000 downloads to recover 5th place
150 dl saterday night mode?
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
UAU, > 500 downloads in less than a second. ?????????????????
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.
Matlab R12 displays boxes for char(8) instead of doing a backspace, breaking this. I don't know of any solution.