matlab GUI 一些基础操作的代码
程序员文章站
2022-04-09 10:30:32
...
GUI 一些基础操作的代码
b=uicontrol('Parent',gcf,'String','颜色设置','Style','pushbutton','callback',...
'c=uisetcolor,set(b,''BackgroundColor'',c);');
close all;
h=waitbar(0,'实例');
get(h);
get(get(h,'Children'))
ha=get(h,'Children');
get(ha,'Children')
hrand=waitbar(0.3,'颜色')
ha1=get(hrand,'Children');
hac=get(ha1,'Children');
hapa=findall(hac,'Type','patch');
set(hapa,'Facecolor','b')
waitbar(0.5,hrand)
dialog
h=dialog('name','关于...','Position',[200 200 200 70]);
uicontrol('parent',h,'style','pushbutton','Position',[80 10 50 20],...
'string','确定','Callback','delete(gcbf)');
errordlg
warndlg
close all
name=inputdlg('请输入姓名','实例');
ret=inputdlg({'请输入姓名','请输入性别'},'实例');
infe=inputdlg('请留言','留言',2);
re=inputdlg({'请输入姓名','请输入性别'},'实例',1,{'lsp','男'},'on');
uigetdir
uigetdir('C:\','liulan');
[Sel,OK]=listdlg(...
'ListString',{'A','B','C','D'},...
'OKString','确定',...
'CancelString','确定',...
'Name','选择',...
'SelectionMode','Single');