MATLAB: Appdesigner button disable not working when called in side pushbutton callback

app designerenableMATLABpushbutton

Hello. I have a pushbutton that I want to prevent the user from pushing agin until the current code has finished.
So I did this
function GetSpectraButtonPushed(app, event)
app.GetSpectraButton.Enable='off') % Disable any further presses of the button
% .. do stuff
app.GetSpectraButton.Enable='on') % Enable button
But its having no effect?

Best Answer

  • Use drawnow to force the figure to update
    % .. do stuff