|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
- close all;
- clear all;
- clc;
- rectangle('position',[0,0,1,1]);
- hold on;
- xlim([-8,8]);
- ylim([0,4]);
- rand('state',0)
- for k=1:8
- gg(k)=plot(rand(1,100),rand(1,100),'.',...
- 'markersize',2,'color',rand(1,3)) ;
- end
- xlim([-8,8]);
- ylim([0,4]);
- set(gcf,'DoubleBuffer','on');
- z=(i+0.5)*ones(1,12);
- sp=rand(1,12)+0.2;
- jd=exp(i*(rand(1,12)*pi/1.5+pi/6));
- S=randperm(12)/3+4;
- for k=1:12;
- hh(k)=plot(z,'.','markersize',S(k),'color',rand(1,3));
- end
- title('banger');qq=1;
- xL=xlabel(['qq=',num2str(qq)],'fontsize',16) ;
- while qq<800;
- z=z+(sp+imag(z).^2/3).*jd;
- sp(real(z)>8 | real(z)<-8)=0.2+...
- rand(1,sum(real(z)>8 | real(z)<-8));
- sp(imag(z)>4 | imag(z)<1)=0.2+...
- rand(1,sum(imag(z)>4 | imag(z)<1));
- jd(real(z)>8 | real(z)<-8)=exp(i*(rand(1,...
- sum(real(z)>8 | real(z)<-8))*pi/1.5+pi/6));
- jd(imag(z)>4 | imag(z)<1)=exp(i*(rand(1,...
- sum(imag(z)>4 | imag(z)<1))*pi/1.5+pi/6));
- z(real(z)>8 | real(z)<-8)=0.5+i;
- z(imag(z)>4 | imag(z)<1)=0.5+i;
- for k=1:12;
- set(hh(k),'xdata',real(z(k)),'ydata',imag(z(k)));
- end
- P=fix(qq/100)+1;
- Px=get(gg(P),'xdata');
- Py=get(gg(P),'ydata');
- Px(end)=[];Py(end)=[];
- set(gg(P),'xdata',Px,'ydata',Py);
- set(xL,'string',['qq=',num2str(qq)])
- pause(0.3);
- qq=qq+1;
- end
复制代码
[ 本帖最后由 suffer 于 2006-11-15 15:32 编辑 ] |
评分
-
1
查看全部评分
-
|