底层代码创建GUI

 1 %底层代码创建GUI
 2 
 3 hf = figure(...
 4     'Units','Normalized',...
 5     'Color','w',...
 6     'Position',[0.1 0.1 0.8 0.8]);
 7 
 8 ha=axes(...
 9     'Parent',hf,...
10     'Units','Normalized',...
11     'Position',[0.1 0.1 0.6 0.8],...
12     'NextPlot','Add');
13 
14 hb1=uicontrol(...
15     'Style','pushbutton',...
16     'Callback','str,delete(cllchild(ha));end',...
17     'String','clear',...
18     'Units','Normalized',...
19     'Position',[0.8 0.2 0.2 0.15]);
20 
21 hb2=uicontrol(...
22     'Style','pushbutton',...
23     'Callback','plot(sin([0:0.01:10]))',...
24     'String','sin',...
25     'Units','Normalized',...
26     'Position',[0.8 0.4 0.2 0.15]);
27 
28 hb3=uicontrol(...
29     'Style','pushbutton',...
30     'Callback','plot(cos([0:0.01:10]))',...
31     'String','cos',...
32     'Units','Normalized',...
33     'Position',[0.8 0.6 0.2 0.15]);

转载于:https://www.cnblogs.com/shixinzei/p/8067233.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值