?? stick.m
字號:
t=[1:1000];
t=mod(t,90);
tr=randn(size(t));
r=cos(t).*cos(t*6)+cos(t*9).*cos(tr*9);
x=r.*cos(t+pi/2);
y=r.*sin(t+pi/2);
H=plot(x,y,'.','markersize',2);
k=1;
xlabel('Please press "space" key and stop this program!',...
'fontsize',12,'color','r');
d=0;
while k
s=get(gcf,'currentkey');
if strcmp(s,'space');
clc;k=0;
end
t=t+cos(d+1);
r=cos(t).*cos(t*6)+cos(t*9).*cos(tr*9);
x=r.*cos(t+pi/2);
y=r.*sin(t+pi/2);
set(H,'xdata',x,'ydata',y);
pause(0.1);
end
figure(gcf);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -