1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
function exemple
uicontrol(...
'style','popupmenu',...
'units','normalized',...
'position',[0 0.5 0.2 0.1],...
'tag','choix_popmenu1',...
'string','14/44|21/34',...
'callback',@gerer_choix)
uicontrol(...
'style','popupmenu',...
'units','normalized',...
'position',[0.2 0.5 0.2 0.1],...
'tag','choix_popmenu2',...
'string','19/29|15/21',...
'callback',@gerer_choix)
uicontrol(...
'style','popupmenu',...
'units','normalized',...
'position',[0.4 0.5 0.2 0.1],...
'tag','choix_popmenu3',...
'string','17/44|17/21|24/30|18/30',...
'callback',@gerer_choix)
uicontrol(...
'style','popupmenu',...
'units','normalized',...
'position',[0.6 0.5 0.2 0.1],...
'tag','choix_popmenu4',...
'string','19/28|21/30',...
'callback',@gerer_choix)
uicontrol(...
'style','edit',...
'units','normalized',...
'position',[0 0 1 0.5],...
'tag','monEdit',...
'string','')
guidata(gcf,guihandles(gcf))
function gerer_choix(obj,evnt)
handles = guidata(gcbf);
Nombre = '14/44 21/34 19/29 15/21 17/44 17/21 24/30 18/30 19/28 21/30';
Nombre = Nombre([get(handles.choix_popmenu1,'value') 10 get(handles.choix_popmenu2,'value') 10 get(handles.choix_popmenu3,'value') 10 get(handles.choix_popmenu4,'value')]);
set(handles.monEdit,'string',Nombre)
guidata(gcbf,handles) |
Partager