📄 xing_bo.m
字号:
%xing_bo
function ui2(action)
if nargin==0,
action='initialize';%初始化
end
switch(action)
case'initialize'
axes('position',[0.1 0.2 0.8 0.8]);
x=0:0.002:8*pi;
h1=plot(x,sin(x),'color','g','erasemode','xor','linewidth',2);%画正弦波
h20=uicontrol('style','pushbutton','string','返回首页','position',[60 10 82 50],'fontsize',15,'fontweight','demi','foregroundcolor',[0.2 0.6 0.4],'backgroundcolor',[0.2 0.6 0.4]);
h21=uicontrol('style','pushbutton','string','Smith圆图','position',[180 10 84 50],'fontsize',12,'fontweight','demi','foregroundcolor',[0.2 0.6 0.4],'backgroundcolor',[0.2 0.6 0.4],'tooltipstring','单击进入圆图演示');
h22=uicontrol('style','pushbutton','string','驻波演示','position',[300 10 82 50],'fontsize',15,'fontweight','demi','foregroundcolor',[0.2 0.6 0.4],'backgroundcolor',[0.2 0.6 0.4],'tooltipstring','单击进入驻波演示');
h23=uicontrol('style','pushbutton','string','退 出','position',[420 10 82 50],'fontsize',15,'fontweight','demi','foregroundcolor',[0.2 0.6 0.4],'backgroundcolor',[0.2 0.6 0.4],'tooltipstring','单击退出演示程序');
%设置控件及其回调函数
set(h20,'callback',['clf;close;main']);
set(h21,'callback',['close;hold off;clf;smith']);
set(h22,'callback',['close;hold off;clf;zhu_bo']);
set(h23,'callback','xing_bo(''callback23'')');
axis([0 25 -1 1])
grid on;
text(11,0.7,'行 波');
for i=1:0.8:100000 %实现动画
y=0.6*sin(x+i/10);
set(h1,'ydata',y);
drawnow
end
case 'callback23'
response1=questdlg(' 确定要退出吗?','提示');
if (strcmp(response1,'Yes'))
close;
pause(0.2);
helpdlg(' 感谢您的使用!','THANK YOU!');
end
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -