hf=figure('Units','Normalized','Menu','none','Color','w','Position',[0.1 0.1 0.7 0.5]);//窗口设置
ha=axes('Parent',hf,'Units','Normalized','Position',[0.1 0.1 0.6 0.8]);//坐标轴
hb1=uicontrol('Style','pushbutton','Callback','try delete(allchildren(ha));end',...
'String','clear','Units','Normalized','Position',[0.8 0.2 0.2 0.15]);//清空按钮
hb2=uicontrol('Style','pushbutton','Callback','plot(sin([0:0.1:10]))',...
'String','sin','Units','Normalized','Position',[0.8 0.4 0.2 0.15]);//sin按钮
hb3=uicontrol('Style','pushbutton','Callback','plot(cos([0:0.1:10]))',...
'String','cos','Units','Normalized','Position',[0.8 0.6 0.2 0.15]);//cos按钮
底层代码实现GUI
最新推荐文章于 2024-04-10 11:16:56 发布