フィルターのクリア

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
  2 件のコメント
Andrew
Andrew 2023 年 11 月 15 日
移動済み: Voss 2023 年 11 月 15 日
Thanks, Voss! Works well!
Voss
Voss 2023 年 11 月 15 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by