MATLAB Answers

pause-clc-fprintf-pause ... fprintf is ignored

조회 수: 1(최근 30일)
Paul Dostert
Paul Dostert 3 Dec 2019
댓글: Navya Seelam 6 Dec 2019
My thinking was that this:
fprintf('Test %d',1)
pause
clc
fprintf('Test %d',2)
pause
should:
  • Print "Test 1"
  • Wait for the user to press a key
  • Clear the Command Window and print "Test 2"
  • Exit when the user presses a key
However, "Test 2" is never printed. Instead a blank screen is displayed. What am I missing?
I'm using MATLAB Online (R2019b)

  댓글 수: 5

표시 이전 댓글 수: 2
Paul Dostert
Paul Dostert 3 Dec 2019
Tried the drawnow() but no luck. It definitely works if the pause is replaced with an input(''), but I'm just curious why the original code doesn't work.
Perhaps you're correct and a clc executes after the next buffer flush?
Paul Dostert
Paul Dostert 4 Dec 2019
Any chance you can try it in MATLAB Online just to verify it is having an issue on there?
Navya Seelam
Navya Seelam 6 Dec 2019
Hi,
I have brought this issue to the notice of our developers. They will investigate the matter further.

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

답변(0개)

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by