⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stick.m

📁 分形计算的几个程序原码
💻 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 + -