필터 지우기
필터 지우기

Button activity only works if I set a breakpoint in Matlab App Designer

조회 수: 1 (최근 30일)
Andrew
Andrew 2023년 11월 15일
댓글: Voss 2023년 11월 15일
I have the App Designer code below that should make the Button invoking the script disappear while the script runs. At completion, I have a command "app.BeginoptimizationButton.Visible="on" to make the button available again. This only works if I put a breakpoint in the script at the place indicated below, and then it works as planned. Without the breakpoint, the button remains visible though the rest of the script runs flawlessly.
I have tried using a lamp to indicate when the script is running with exactly the same problem: the lamp doesn't change without a breakpoint at the line where the command is located.
I can't figure out what to do to fix this and would greatly appreciate any advice.
Thanks,
Andy
____________________________________________
% Button pushed function: BeginoptimizationButton
function BeginoptimizationButtonPushed(app, event)
'Starting optimization'
app.MinMethod='fminsearchbnd';
app.approachinfo=['Approach: Revised Starling model using ',app.MinMethod];
app.solverinfo='solver: ode15s';
<breakpoint> app.BeginoptimizationButton.Visible="off";
t=app.t;
etc.

채택된 답변

Voss
Voss 2023년 11월 15일
Put a drawnow after lines of code that make changes to the GUI which should take effect immediately, e.g.:
% starting optimization
app.BeginoptimizationButton.Visible="off";
drawnow
% ...
% ...
app.BeginoptimizationButton.Visible="on";
drawnow

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by