function gui_pop_men
close all
hFig =
figure(...
'units','pixels',...
'position',[400 300 500 300],...
'menubar','none',...
'name','gui_pop_menu',...
'numbertitle','off',...
'resize','on');
hPopup =
uicontrol(...
'Parent',hFig,...
'style','popupmenu',...
'unit','pix',...
'position',[30 60 100 20],...
'fontsize',16,...
'fontweight','bold',...
'string',{'20';'80';'940';'150'},... % imprime
'value',1,...
'Callback',@Popup_Callback);
hOutput =
uicontrol(...
'Parent',hFig,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'FontSize',16,...
'ForegroundColor',[0 0 0],...
'Position',[5 0.5 16 2.5],...
'String','First',...%% visualiza
'value',1,...
'Style','edit');
hOutputb =
uicontrol(...
'Parent',hFig,...
'Units','characters',...
'BackgroundColor',[1 1 1],...
'FontSize',16,...
'ForegroundColor',[0 0 0],...
'Position',[25 0.5 16 2.5],...
'String','Second',... %% visualiza
'value',1,...
'Style','edit');
function Popup_Callback(hObject, eventdata);
Ax =
get(hPopup,'String');
By =
get(hPopup,'Value');
Cz = Ax{By};
set(hOutput,'String',Cz);
Dn =
log10(str2num(Cz));
set(hOutputb,'String',Dn);
end
end
José Jeremías Caballero
Servicios de Programación en MatLab
Lima - Perú
No hay comentarios.:
Publicar un comentario