Button activity only works if I set a breakpoint in Matlab App Designer
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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.
0 comentarios
Respuesta aceptada
Voss
el 15 de Nov. de 2023
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 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!