
problema con el dimensionado de gui en Matlab
Publicado por Hector (15 intervenciones) el 29/12/2013 20:24:54
Hola a todos,
estoy intentando diseñar una GUI en Matlab, pero tengo problemas cuando la abro en distintos monitores, es decir, no se ajusta correctamente a la pantalla del ordenador que estoy utilizando.
He intentado de todo, pero nada que lo puedo solucionar. He usado el handle_list, la función ResizeFcn, utilizar el java frame para darle un tamaño fijo la GUI y normalizar las unidades de la figura, pero nada de eso me ha ayudado.
Os adjunto mi código y agradezco cualquier colaboración que me pudieseis brindar,
function First_Essay
hFig = figure('Units','characters',....
'Menubar','none', 'Name', 'Meru RAM',....
'NumberTitle','off',....
'Position',[1.8 10 161 41],'resize', 'on');
s = warning('off', 'MATLAB:uitabgroup:OldVersion');
hTabGroup = uitabgroup('Parent',hFig);
set(hFig, 'Visible','on');
warning(s);
%------------------------------------------------------Tabs----------------------------------------------------------------%
hTab1 = uitab('Parent',hTabGroup, 'Title','Essay for 217','Units','characters');
%-----------------------------------------------------Panels----------------------------------------------------------------
hA = uipanel( hTab1,'Position',[.01,.01,.98,1], 'Units','characters','Title','Essay','Fontsize',22,.....
'FontAngle','italic','BackgroundColor','white','BorderWidth',5);
%---------------------------------------------------Sub_Panels--------------------------------------------------------------
% 217 Plus Sub Panels
hRelisPanel1 = uipanel('Parent',hTab1,'Units','characters','Title','Previous Selection','Fontsize',20,.....
'BackgroundColor',[1 1 1],'Position',[5 35 135 45],'BorderWidth',2);
% 217 Plus Sub Panels
hRelisSubPanel1 = uipanel('Parent',hRelisPanel1,'Units','characters','Title','Pick your device ','Fontsize',14,.....
'BackgroundColor',[1 1 1],'Position',[1 34 132 8],'BorderWidth',1);
% 217 Plus Sub Panels
hRelisSubPanel2 = uipanel('Parent',hRelisPanel1,'Units','characters','Title','Base frate','Fontsize',14,.....
'BackgroundColor',[1 1 1],'Position',[1 17 65 16],'BorderWidth',1);
% 217 Plus Sub Panels
hRelisSubPanel3 = uipanel('Parent',hRelisPanel1,'Units','characters','Title','Parameters','Fontsize',14,.....
'BackgroundColor',[1 1 1],'Position',[68 17 65 16],'BorderWidth',1);
% 217 Plus Sub Panels
hRelisSubPanel4 = uipanel('Parent',hRelisPanel1,'Units','characters','Title','Frate multipliers','Fontsize',14,.....
'BackgroundColor',[1 1 1],'Position',[1 1 132 15],'BorderWidth',1);
%-----------------------------------------------------------------------------------------------------------------
%------------------------------------------------- 217 Base pick your device popups------------------------------------------------
hPopupMenu1 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],'FontSize',20,...
'ForegroundColor',[0 0 0],'Position',[1 -2.8 28 8],'String',{'Device';'Active Device';'Passive Device';'Special Device'},...
'Style','popup','Value',1,'Callback',@PopupMenu1_Callback);
hPopupMenu2 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],'FontSize',20,...
'ForegroundColor',[0 0 0],'Position',[30 -1.5 28 8],'String',{'Select Type'},...
'Style','popup','Value',1,'Callback',@PopupMenu2_Callback);
hPopupMenu3 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],'FontSize',20,...
'ForegroundColor',[0 0 0],'Position',[30 -4.5 28 8],'String',{'Select Model'},...
'Style','popup','Value',1,'Callback',@PopupMenu3_Callback);
hPopupMenu4 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],'FontSize',20,...
'ForegroundColor',[0 0 0],'Position',[58 -2.8 28 8],'String',{'Select Year','1993',....
'1994','1995','1996','1997','1998','1999',....
'2000','2001','2002','2003','2004','2005','2006','2007','2008','2009',....
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019',....
'2020','2021','2022','2023','2024','2025','2026','2027','2028','2029'},...
'Style','popup','Value',1,'Callback',@PopupMenu4_Callback);
%------------------------------------------------- 217 parameters popups------------------------------------------------------------
hPopupMenu5 = uicontrol('Parent',hRelisSubPanel3,'Units','characters','BackgroundColor',[1 1 1],'FontSize',20,...
'ForegroundColor',[0 0 0],'Position',[1 4.5 28 8],'String',{'Duty Cycle'},...
'Style','popup','Value',1,'Callback',@PopupMenu5_Callback);
%------------------------------------------------- 217 Base frate output ---------------------------------------------------
hOut1label = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[1 10 9.5 2],...
'String','lOB :','Style','text');
hOutput1 = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[9.5 9.8 20 2.5],...
'String',{'Operating'},'value',0,'Style','edit');
%-----##
hOut2label = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[33 10 9 2],...
'String','lEB :','Style','text');
hOutput2 = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[42 10 20 2.5],...
'String',{'Environmental'},'value',0,'Style','edit');
%
% %-----##
hOut3label = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[1 5.5 8 2],...
'String','lTB :','Style','text');
hOutput3 = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[9.5 5.5 20 2.5],...
'String',{'Temp Cycling'},'value',0,'Style','edit');
% %-----##
hOut4label = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[33 5.5 8 2],...
'String','lIN :','Style','text');
hOutput4 = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[42 5.5 20 2.5],...
'String',{'Electrical Stress'},'value',0,'Style','edit');
% %-----##
hOut5label = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[18 1 9 2],...
'String','lZC :','Style','text');
hOutput5 = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[26 1 20 2.5],...
'String',{'Solder joint'},'value',0,'Style','edit');
% %-----##
hOut6label = uicontrol('Parent',hRelisPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[137 1 13 2],...
'String','Results :','Style','text');
hOutput6 = uicontrol('Parent',hRelisPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[151 0.5 16 2.5],...
'String',{''},'value',0,'Style','edit');
% %-----##
hOut7label = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[106 3.9 13 2],...
'String','Y :','Style','text');
hOutput7 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[110 3.7 21 2.5],...
'String',{'Y. of Manufacture'},'value',0,'Style','edit');
% %-----##
hOut8label = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[106 0.8 5 2],...
'String','b :','Style','text');
hOutput8 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[110 0.7 21 2.5],...
'String',{'Growth Constant'},'value',0,'Style','edit');
%------------------------------------------------- 217 Frate multipliers -----------------------------------------------------------------
% %-----##
hFRMPIGlabel = uicontrol('Parent',hRelisSubPanel4,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',25,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[1 10 7 2],...
'String','pm :','Style','text');
hFRMPIGOut = uicontrol('Parent',hRelisSubPanel4,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[8.5 9.5 21 2.5],...
'String',{'Reliability Growth'},'value',0,'Style','edit');
%------------------------------------------------------- 217 EVALUATION FUNCTION BEGINS -------------------------------
function PopupMenu1_Callback(hObject, eventdata)
Active = {'Diode','Transistor','Relay','Etce'};
Passive = {'Capacitor','Resistor','Inductor'};
Special = {'PMTs','Optoelectronic','IC Hermetic'};
if isequal(get(hPopupMenu1,'value'),1);
set(hPopupMenu2,'string','Select')
elseif isequal(get(hPopupMenu1,'value'),2);
set(hPopupMenu2,'string',Active)
else isequal(get(hPopupMenu1,'value'),3);
set(hPopupMenu2,'string',Passive)
if isequal(get(hPopupMenu1,'value'),4);
set(hPopupMenu2,'string',Special)
end
end
end
function PopupMenu2_Callback(hObject, eventdata)
Diode = {'CurrentReg','HFMicro','HFMicroRF','HFMicroRFPIN','HFMicroRFSchottky'};
Transistor = {'BipolarGer','BipolarHFMicro','BipolarLF','BipolarMul','FieldEffectHFMicro'};
Relay = {'GralPurpose', 'Reed', 'SolidSt', 'Thermal','TimeDelay'};
if isequal(get(hPopupMenu2,'value'),1);
set(hPopupMenu3,'string',Diode)
elseif isequal(get(hPopupMenu2,'value'),2);
set(hPopupMenu3,'string',Transistor)
else isequal(get(hPopupMenu2,'value'),3);
set(hPopupMenu3,'string',Relay)
end
end
function PopupMenu3_Callback(hObject,eventdata)
switch get(hObject,'value')
case 1
v = {3,5,6,2,2};
case 2
v = {1,2,3,3,3};
case 3
v = {4,5,6,5,6};
case 4
v = {7,8,9,3,7};
case 5
v = {1,3,4,2,8};
end
set(hOutput1,'value',v{1})
set(hOutput2,'value',v{2})
set(hOutput3,'value',v{3})
set(hOutput4,'value',v{4})
set(hOutput5,'value',v{5})
set(hOutput1,'string',get(hOutput1,'value'))
set(hOutput2,'string',get(hOutput2,'value'))
set(hOutput3,'string',get(hOutput3,'value'))
set(hOutput4,'string',get(hOutput4,'value'))
set(hOutput5,'string',get(hOutput5,'value'))
set(hOutput6,'string',get(hOutput1,'value')+get(hOutput2,'value')+get(hOutput3,'value')+get(hOutput4,'value')+get(hOutput5,'value'))
end
function PopupMenu4_Callback(hObject, eventdata);
Ax = get(hPopupMenu4,'String');
By = get(hPopupMenu4,'Value');
Cz = Ax{By};
set(hOutput7,'String',Cz);
Dn = log10(str2num(Cz));
set(hOutput8,'String',Dn);
end
end
estoy intentando diseñar una GUI en Matlab, pero tengo problemas cuando la abro en distintos monitores, es decir, no se ajusta correctamente a la pantalla del ordenador que estoy utilizando.
He intentado de todo, pero nada que lo puedo solucionar. He usado el handle_list, la función ResizeFcn, utilizar el java frame para darle un tamaño fijo la GUI y normalizar las unidades de la figura, pero nada de eso me ha ayudado.
Os adjunto mi código y agradezco cualquier colaboración que me pudieseis brindar,
function First_Essay
hFig = figure('Units','characters',....
'Menubar','none', 'Name', 'Meru RAM',....
'NumberTitle','off',....
'Position',[1.8 10 161 41],'resize', 'on');
s = warning('off', 'MATLAB:uitabgroup:OldVersion');
hTabGroup = uitabgroup('Parent',hFig);
set(hFig, 'Visible','on');
warning(s);
%------------------------------------------------------Tabs----------------------------------------------------------------%
hTab1 = uitab('Parent',hTabGroup, 'Title','Essay for 217','Units','characters');
%-----------------------------------------------------Panels----------------------------------------------------------------
hA = uipanel( hTab1,'Position',[.01,.01,.98,1], 'Units','characters','Title','Essay','Fontsize',22,.....
'FontAngle','italic','BackgroundColor','white','BorderWidth',5);
%---------------------------------------------------Sub_Panels--------------------------------------------------------------
% 217 Plus Sub Panels
hRelisPanel1 = uipanel('Parent',hTab1,'Units','characters','Title','Previous Selection','Fontsize',20,.....
'BackgroundColor',[1 1 1],'Position',[5 35 135 45],'BorderWidth',2);
% 217 Plus Sub Panels
hRelisSubPanel1 = uipanel('Parent',hRelisPanel1,'Units','characters','Title','Pick your device ','Fontsize',14,.....
'BackgroundColor',[1 1 1],'Position',[1 34 132 8],'BorderWidth',1);
% 217 Plus Sub Panels
hRelisSubPanel2 = uipanel('Parent',hRelisPanel1,'Units','characters','Title','Base frate','Fontsize',14,.....
'BackgroundColor',[1 1 1],'Position',[1 17 65 16],'BorderWidth',1);
% 217 Plus Sub Panels
hRelisSubPanel3 = uipanel('Parent',hRelisPanel1,'Units','characters','Title','Parameters','Fontsize',14,.....
'BackgroundColor',[1 1 1],'Position',[68 17 65 16],'BorderWidth',1);
% 217 Plus Sub Panels
hRelisSubPanel4 = uipanel('Parent',hRelisPanel1,'Units','characters','Title','Frate multipliers','Fontsize',14,.....
'BackgroundColor',[1 1 1],'Position',[1 1 132 15],'BorderWidth',1);
%-----------------------------------------------------------------------------------------------------------------
%------------------------------------------------- 217 Base pick your device popups------------------------------------------------
hPopupMenu1 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],'FontSize',20,...
'ForegroundColor',[0 0 0],'Position',[1 -2.8 28 8],'String',{'Device';'Active Device';'Passive Device';'Special Device'},...
'Style','popup','Value',1,'Callback',@PopupMenu1_Callback);
hPopupMenu2 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],'FontSize',20,...
'ForegroundColor',[0 0 0],'Position',[30 -1.5 28 8],'String',{'Select Type'},...
'Style','popup','Value',1,'Callback',@PopupMenu2_Callback);
hPopupMenu3 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],'FontSize',20,...
'ForegroundColor',[0 0 0],'Position',[30 -4.5 28 8],'String',{'Select Model'},...
'Style','popup','Value',1,'Callback',@PopupMenu3_Callback);
hPopupMenu4 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],'FontSize',20,...
'ForegroundColor',[0 0 0],'Position',[58 -2.8 28 8],'String',{'Select Year','1993',....
'1994','1995','1996','1997','1998','1999',....
'2000','2001','2002','2003','2004','2005','2006','2007','2008','2009',....
'2010','2011','2012','2013','2014','2015','2016','2017','2018','2019',....
'2020','2021','2022','2023','2024','2025','2026','2027','2028','2029'},...
'Style','popup','Value',1,'Callback',@PopupMenu4_Callback);
%------------------------------------------------- 217 parameters popups------------------------------------------------------------
hPopupMenu5 = uicontrol('Parent',hRelisSubPanel3,'Units','characters','BackgroundColor',[1 1 1],'FontSize',20,...
'ForegroundColor',[0 0 0],'Position',[1 4.5 28 8],'String',{'Duty Cycle'},...
'Style','popup','Value',1,'Callback',@PopupMenu5_Callback);
%------------------------------------------------- 217 Base frate output ---------------------------------------------------
hOut1label = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[1 10 9.5 2],...
'String','lOB :','Style','text');
hOutput1 = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[9.5 9.8 20 2.5],...
'String',{'Operating'},'value',0,'Style','edit');
%-----##
hOut2label = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[33 10 9 2],...
'String','lEB :','Style','text');
hOutput2 = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[42 10 20 2.5],...
'String',{'Environmental'},'value',0,'Style','edit');
%
% %-----##
hOut3label = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[1 5.5 8 2],...
'String','lTB :','Style','text');
hOutput3 = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[9.5 5.5 20 2.5],...
'String',{'Temp Cycling'},'value',0,'Style','edit');
% %-----##
hOut4label = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[33 5.5 8 2],...
'String','lIN :','Style','text');
hOutput4 = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[42 5.5 20 2.5],...
'String',{'Electrical Stress'},'value',0,'Style','edit');
% %-----##
hOut5label = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[18 1 9 2],...
'String','lZC :','Style','text');
hOutput5 = uicontrol('Parent',hRelisSubPanel2,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[26 1 20 2.5],...
'String',{'Solder joint'},'value',0,'Style','edit');
% %-----##
hOut6label = uicontrol('Parent',hRelisPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[137 1 13 2],...
'String','Results :','Style','text');
hOutput6 = uicontrol('Parent',hRelisPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[151 0.5 16 2.5],...
'String',{''},'value',0,'Style','edit');
% %-----##
hOut7label = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[106 3.9 13 2],...
'String','Y :','Style','text');
hOutput7 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[110 3.7 21 2.5],...
'String',{'Y. of Manufacture'},'value',0,'Style','edit');
% %-----##
hOut8label = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',20,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[106 0.8 5 2],...
'String','b :','Style','text');
hOutput8 = uicontrol('Parent',hRelisSubPanel1,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[110 0.7 21 2.5],...
'String',{'Growth Constant'},'value',0,'Style','edit');
%------------------------------------------------- 217 Frate multipliers -----------------------------------------------------------------
% %-----##
hFRMPIGlabel = uicontrol('Parent',hRelisSubPanel4,'Units','characters','BackgroundColor',[1 1 1],...
'FontName','symbol','FontSize',25,'ForegroundColor',[0 0 0],'HorizontalAlignment','left','Position',[1 10 7 2],...
'String','pm :','Style','text');
hFRMPIGOut = uicontrol('Parent',hRelisSubPanel4,'Units','characters','BackgroundColor',[1 1 1],...
'FontSize',14,'ForegroundColor',[0 0 0],'Position',[8.5 9.5 21 2.5],...
'String',{'Reliability Growth'},'value',0,'Style','edit');
%------------------------------------------------------- 217 EVALUATION FUNCTION BEGINS -------------------------------
function PopupMenu1_Callback(hObject, eventdata)
Active = {'Diode','Transistor','Relay','Etce'};
Passive = {'Capacitor','Resistor','Inductor'};
Special = {'PMTs','Optoelectronic','IC Hermetic'};
if isequal(get(hPopupMenu1,'value'),1);
set(hPopupMenu2,'string','Select')
elseif isequal(get(hPopupMenu1,'value'),2);
set(hPopupMenu2,'string',Active)
else isequal(get(hPopupMenu1,'value'),3);
set(hPopupMenu2,'string',Passive)
if isequal(get(hPopupMenu1,'value'),4);
set(hPopupMenu2,'string',Special)
end
end
end
function PopupMenu2_Callback(hObject, eventdata)
Diode = {'CurrentReg','HFMicro','HFMicroRF','HFMicroRFPIN','HFMicroRFSchottky'};
Transistor = {'BipolarGer','BipolarHFMicro','BipolarLF','BipolarMul','FieldEffectHFMicro'};
Relay = {'GralPurpose', 'Reed', 'SolidSt', 'Thermal','TimeDelay'};
if isequal(get(hPopupMenu2,'value'),1);
set(hPopupMenu3,'string',Diode)
elseif isequal(get(hPopupMenu2,'value'),2);
set(hPopupMenu3,'string',Transistor)
else isequal(get(hPopupMenu2,'value'),3);
set(hPopupMenu3,'string',Relay)
end
end
function PopupMenu3_Callback(hObject,eventdata)
switch get(hObject,'value')
case 1
v = {3,5,6,2,2};
case 2
v = {1,2,3,3,3};
case 3
v = {4,5,6,5,6};
case 4
v = {7,8,9,3,7};
case 5
v = {1,3,4,2,8};
end
set(hOutput1,'value',v{1})
set(hOutput2,'value',v{2})
set(hOutput3,'value',v{3})
set(hOutput4,'value',v{4})
set(hOutput5,'value',v{5})
set(hOutput1,'string',get(hOutput1,'value'))
set(hOutput2,'string',get(hOutput2,'value'))
set(hOutput3,'string',get(hOutput3,'value'))
set(hOutput4,'string',get(hOutput4,'value'))
set(hOutput5,'string',get(hOutput5,'value'))
set(hOutput6,'string',get(hOutput1,'value')+get(hOutput2,'value')+get(hOutput3,'value')+get(hOutput4,'value')+get(hOutput5,'value'))
end
function PopupMenu4_Callback(hObject, eventdata);
Ax = get(hPopupMenu4,'String');
By = get(hPopupMenu4,'Value');
Cz = Ax{By};
set(hOutput7,'String',Cz);
Dn = log10(str2num(Cz));
set(hOutput8,'String',Dn);
end
end
Valora esta pregunta


0