MATLAB: Gui pop up menu selection

guipop up menuradio button

Hello,
I am associating a panel with four radio buttons with a pop up menu. Using the radio buttons to select different menu that could occur on the pop up menu. I have the menu choices stored in a string:
set(handles.ctqMenu, 'String', ctqString);
the index of each menu that could possible be selected is different. Once the specific menu is chosen how to I go about storing which index of that menu the user has chosen. For example if the menu options weree:
ctqString = {'Option0'; 'Option1'; 'Option 2'; 'Option3'};
So in a nutshellI am selecting a specific menu via radio buttons and now need to create a way to store which option the user chose of that selected menu.
Thank you

Best Answer

In your radio button (actually the button group since you must have 4 exclusive radio buttons) SelectionChangeFcn callback function:
Tag=get(hObject,'Tag')
switch Tag
case 'radiobutton1'
ctqString= {'Option0'; 'Option1'; 'Option 2'; 'Option3'};
case 'radiobutton2'
ctqString= {'Option10'; 'Option11'; 'Option 12'};
end
set(handles.ctqMenu,'String',ctqString);