Matlab GUI,颜色对话框,设置按钮背景颜色

来源:互联网 发布:趋势科技杀毒软件 知乎 编辑:程序博客网 时间:2024/06/06 21:02
f=figure;b=uicontrol('Parent',f,'Style','Pushbutton','String','颜色设置',...    'Callback','c=uisetcolor();if length(c)==1 else set(b,''BackgroundColor'',c); end;');% uisetcolor() 颜色对话框。     set(b,''BackgroundColor'',c) 设置按钮背景颜色