📄 zuniwodong.m
字号:
n=1;w=6;ww=sqrt(w^2-n^2);B1=80;B2=-20;
close all
figure;
axis([-105,105,-105,105])
hold on
set(gcf,'doublebuffer','on');
G=plot(100,0,'r'); % 句柄[轨迹]
x=100;y=0;
r=2;
t1=r*sin(0:.1:2*pi);
t2=r*cos(0:.1:2*pi);
X=x+r*t1;Y=y+r*t2;
Q=fill(X,Y,rand(1,3)); % 句柄[球]
t=0;
plot([-100,100],[0,0]);
plot([0,0],[-100,100]);
k=1;
xlabel('Please press "space" key and stop this program!',...
'fontsize',14,'color','r');
title(['《damp turbination》 ','B1=',num2str(B1),...
'; B2=',num2str(B2)],'fontsize',14);
while k
s=get(gcf,'currentkey');
if strcmp(s,'space');
clc;k=0;
end
pause(0.3);
z=exp(-n*t)*(B1*exp(i*ww*t)+B2*exp(-i*ww*t));
xp=real(z);yp=imag(z);
r=0.5+1.5*exp(-n*t);
X=xp+t1*r;Y=yp+t2*r;
set(Q,'xdata',X,'ydata',Y);
x=[x,xp];y=[y,yp];
set(G,'xdata',x,'ydata',y);
t=t+0.02;
end
figure(gcf);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -