MATLAB: GUI of the button

button

Hi, I want to ask about button.
If the button want to be use once ,then the button couldn't be use,
anyway, button is used once,not twice or three times,
So, how to set the button for code.
Teach me, thank you!

Best Answer

In its callback, disable it after it's pushed:
figure;
uicontrol('string','Push Me!','position',[10 10 100 50],'callback',@(src,evt)set(src,'enable','inactive','string','Now you can''t'));