How can I load data from popup menu in figure 1 into edit text in figure 2?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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?
0 comentarios
Respuesta aceptada
Walter Roberson
el 4 de Mayo de 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);
0 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!