필터 지우기
필터 지우기

why set sentence appears just when run step by step ?

조회 수: 2 (최근 30일)
Rana Muayad
Rana Muayad 2021년 8월 17일
댓글: Walter Roberson 2021년 8월 19일
hi,
I have a program in the graphical interface of Matlab that has 3 push buttons, each one performs a specific task, but all of them start writing a static text sentence using set command. When executing, the first button appears, but when the other two buttons are executed, the sentence does not appear, it appears only when executing step by step. What is the reason for that?
  댓글 수: 5
Rana Muayad
Rana Muayad 2021년 8월 19일
it's part of code not full code
Walter Roberson
Walter Roberson 2021년 8월 19일
It would be... unusual... for someone to abbreviate full code that does not use global variables, as code that does use global variables when they post asking for advice... except possibly for cases where the poster was supplying a (semi-) working example with the global variables acting to "stub out" the rest of the program.
But the posted code was not a working example, so the only self-consistent explanation is that the full code uses global variables as well. And in that case, Rik's question of why global variables are being used is still relevant.

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

답변 (1개)

Walter Roberson
Walter Roberson 2021년 8월 19일
Screen updates are made under the following circumstances:
  • figure() is called to activate an existing figure
  • figure() is called to create a new figure
  • drawnow() is executed
  • pause() is executed
  • uiwait() or waitfor() are called (uiwait() calls waitfor())
  • program returns to keyboard execution, such as if execution finishes, or a breakpoint is reached, or the program uses keyboard()
Your code is not doing anything to request an update after changing the graphics properties, so the change to the visible display will wait until... whenever it happens.
When you need a screen update, call drawnow()

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by