MATLAB: How to load data from popup menu in figure 1 into edit text in figure 2

#popupmenu #calendar

I use popup menu to make such as calendar in GUI, I use 2 figures, one for saving all data, and another for load data from figure 1. My calender consist of 3 popup menus, they're for date, month, and year. In figure 2, I'm going to load data from 3 popup menus into 1 edit text. What I'm expect is this edit text will consist of "data+month+year". But I haven't found the way it can possible yet. Could you help me?

Best Answer

alldates = cellstr(get(handles.popup1, 'String'));
idx = get(handles.popup1, 'Value');
thisdate = alldates{idx};
allmonth = cellstr(get(handles.popup2, 'String'));
idx = get(handles.popup2, 'Value');
thismonth = allmonth{idx};
allyear = cellstr(get(handles.popup3, 'String'));
idx = get(handles.popup3, 'Value');
thisyear = allyear{idx};
datestring = [thisdate, '+', thismonth, '+', thisyear];
set(handles.edit1, 'String', datestring);