Aug 26, 2005 #1 neuroscience Bioengineer Joined Aug 26, 2005 Messages 1 Location US 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??
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??
Aug 29, 2005 #2 MikeyP Aerospace Joined Mar 5, 2002 Messages 940 Location GB Add a variable to the figure's 'User' property called eg "counter". 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 = get(gcf, 'User') counter = counter+1; if counter == 8 %code to reset GUI here counter == 0; end set(gcf, 'User', counter); M -- Dr Michael F Platten Upvote 0 Downvote
Add a variable to the figure's 'User' property called eg "counter". 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 = get(gcf, 'User') counter = counter+1; if counter == 8 %code to reset GUI here counter == 0; end set(gcf, 'User', counter); M -- Dr Michael F Platten