Registering Button clicks in MatLab GUI
Registering Button clicks in MatLab GUI
(OP)
I have a GUI with 8 push-buttons and I need to count which button was clicked and the order this clicking occured. Additionally, I need the GUI to reset after n amount of clicks occured. Any suggestions??





RE: Registering Button clicks in MatLab GUI
when you set up the GUI set this value to zero.
eg,
counter = 0;
set(gcf,'User', counter);
Then in the callback for each button put in lines something like
CODE
counter = counter+1;
if counter == 8
%code to reset GUI here
counter == 0;
end
set(gcf, 'User', counter);
--
Dr Michael F Platten