Filter löschen
Filter löschen

How can I load data from popup menu in figure 1 into edit text in figure 2?

1 Ansicht (letzte 30 Tage)
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?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 4 Mai 2013
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);

Weitere Antworten (1)

Indri Djon Hansemit
Indri Djon Hansemit am 7 Mai 2013
well thankyou Mr. Roberson, finally I did it.. :D

Kategorien

Mehr zu Dates and Time finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by