MATLAB: Can i control Pop up menu depending on other pop up menu drop down
guiMATLABmatlab guipop up menu
Hello all,
I have two pop up menus namely pop1 and pop 2 with selections 1,2,3 each respectively. is it possible to implement like if i select 1 in pop1 automatically even in pop2 1 should be selected.
Best Answer
Yes.
function Pop1_Callback(hObject, eventdata, handles)
Vlad - assuming that you are using GUIDE to create your GUI, suppose your five popup menus are namedpopupmenu1,popupmenu2,...,popupmenu5. If we assume that only numeric data has populated each of your popup menus, then the callback for your push button would look something like
function pushbutton1_Callback(hObject, eventdata, handles)
% get the list of items in the first popup menu
menu1List = get(handles.popupmenu1,'String');
% get the selected item in the first popup menu and convert to a number
Best Answer