MATLAB: How to get the inputs given in gui by user into main code

MATLABmatlab gui

Hi,
I am looking for a code that helps me in passing tag names of all the buttons which are on in gui into the another matlab code.
Thanks in Advance.

Best Answer

t = unique(get(findobj(0, 'type', 'uicontrol', 'style','radio', '-or', 'style', 'push'),'tag'));
t( cellfun(@isempty, t) ) = []; %remove empty tags
Now t is a cell array of the tags of only the radio and push buttons.
You might prefer to replace the 0 with the handle of the figure of the GUI.
Note also: if you used GUIDE, then some of the handles might be set to callback visibility. If so and you need to find them anyhow, then change findobj() to findall()