青年梦想家 发表于 2015-7-26 23:56

【奠基经典】MATLAB实用程序案例之曲线转换按钮







曲线转换按钮
实例:
h0=figure('toolbar','none',...
'position',,...
'name','实例33');
x=0:0.5:2*pi;
y=sin(x);
h=plot(x,y);
grid on
huidiao=[...
'if i==1,',...
'i=0;,',...
'y=cos(x);,',...
'delete(h),',...
'set(hm,''string'',''正弦函数''),',...
'h=plot(x,y);,',...
'grid on,',...
'else if i==0,',...
'i=1;,',...
'y=sin(x);,',...
'set(hm,''string'',''余弦函数''),',...
'delete(h),',...
'h=plot(x,y);,',...
'grid on,',...
'end,',...
'end'];
hm=uicontrol(gcf,'style','pushbutton',...
'string','余弦函数',...
'callback',huidiao);
i=1;
set(hm,'position',);
set(gca,'position',)
title('按钮的使用')
hold on


关于本帖内容欢迎大家踊跃讨论,与在下交流!


页: [1]
查看完整版本: 【奠基经典】MATLAB实用程序案例之曲线转换按钮