How do I erase something I printed in the command window (to print something else instead)?

Hi,
Doesn't it sometimes bother you to let something run for hours and not see the progress, so that all you've got is to believe the 'busy' status of MATLAB?
Well,then it could be very friendly to display completion percentage. But all that i know is to fprintf something and never erase it. Now if i have many tasks running i'd like to know their status without having to type a list of percentages on the screen. For that i wanna know how to delete characters from the command window.
Thnx!

 채택된 답변

You could use waitbar(). It's much nicer.
If you really want to erase what you've already printed, use
fprintf('\b')
For example,
fprintf('%%43');fprintf('\b\b\b');fprintf('%%45')

추가 답변 (2개)

Friedrich
Friedrich 2011년 8월 31일
Hi,
you could use the clc command to clear the whole command window:

댓글 수: 1

Alas! But the whole point is to keep the text on screen.
For example:
# Program intro msg
# Main parameters shown
# Process 1 . . . Done. (say we had it throug with process 1)
# Process 2 . . . 43%
without having to print:
1%
2%
3%
.
.
.
N%

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

태그

질문:

2011년 8월 31일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by