MATLAB: How to enable a button after another button’s procedure has completed in App Designer

appdesignercallbackenableMATLAB

I am looking for an example that shows two things:
1. How to show an app is busy while computing something
2. How to enable a button after that computation is done

Best Answer

Attached is a simple app that accomplishes this as an example. The relevant code is in the first button's callback:
function computeFunction(app, event)
set(app.NotComputingLabel, 'Text', 'Computing...')
% your computation
pause(3);
set(app.NotComputingLabel, 'Text', 'Done Computing!')
set(app.AccessibleAfterComputeButton, 'Enable', 'on')
end
You can set the second button to be disabled by selecting it in the Design View and changing the "Enable" property on the right, in the "Button Properties" section.