hf=figure('Color',[0,1,1],'Position',[100,200,400,200],'Name','数值转换','NumberTitle','off','MenuBar','none');
uicontrol(hf,'Style','text','Position',[80,160,40,20],'HorizontalAlignment','center','String','输入框','BackgroundColor',[0,1,1]);
uicontrol(hf,'Style','text','Position',[280,160,40,20],'HorizontalAlignment','center','String','输出框','BackgroundColor',[0,1,1]);
uicontrol(hf,'Style','frame','Position',[20,65,165,90],'BackgroundColor',[1,1,0]);
uicontrol(hf,'Style','text','Position',[25,110,85,25],'HorizontalAlignment','center','String','十进制','BackgroundColor',[1,1,0]);
uicontrol(hf,'Style','text','Position',[25,75,85,25],'HorizontalAlignment','center','String','2~16进制','BackgroundColor',[1,1,0]);
he1=uicontrol(hf,'Style','edit','Position',[110,115,60,25],'BackgroundColor',[0,1,0]);
he2=uicontrol(hf,'Style','edit','Position',[110,80,60,25],'BackgroundColor',[0,1,0]);
uicontrol(hf,'Style','frame','Position',[215,65,165,90],'BackgroundColor',[1,1,0]);
ht=uicontrol(hf,'Style','text','Position',[255,95,90,30],'HorizontalAlignment','center','BackgroundColor',[0,1,0]);
COMM=['n=str2num(get(he1,''string''));','b=str2num(get(he2,''string''));','dec=trdec(n,b);','set(ht,''string'',dec);'];
uicontrol(hf,'Style','pushbutton','Position',[55,20,90,25],'String','转 换','Callback',COMM);
uicontrol(hf,'Style','pushbutton','Position',[255,20,90,30],'String','退 出','Callback','close(hf)');
