I'm writing a Gui in matlab but I have a problem with popups. This is the code I wrote:
str=get(handles.popupmenu1, 'String');
val=get(handles.popupmenu1, 'Value');
switch str{val}
case 1
val=Normal;
case 2
val=t;
end
handles.val = val;
guidata(handles.figure1, handles);
I want to use the string in the popup in another function as its input. But matlab selects both the values, Normal and t, so that the other function (garchfit) does not work. How can I tell Matlab to get just the String the user selects? Thank you