您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 其它文档 > matlab动画制作源代码
clearall;closeall;t1=linspace(0,2*pi);x1=-9;y1=0;r1=1;hf1=fill(r1*cos(t1)+x1,r1*sin(t1)+y1,'r');%»Ì«Ñôholdon;axis([-10,10,-10,10]);axisoffhf2=fill([-1-111],[-10-8-8-10],'y');%»Ê÷hf3=fill([-2,2,0],[-8,-8,-6],'g');sita1=pi;%µÚÒ»´ÎÉú³¤fori=0:6;%°×Ììtc=rand(1,3);title('ÈÕ¸´Ò»ÈÕ£¬Ð¡Ê÷ÂýÂýÂýÂýµØ³¤´ó¡£¡£¡£¡£','color',tc,'fontweight','bold');set(gcf,'color','w');x2=0;y2=0;r2=9;x1=r2*cos(sita1-pi/6*i)+x2;y1=r2*sin(sita1-pi/6*i)+y2;set(hf1,'xdata',r1*cos(t1)+x1,'ydata',r1*sin(t1)+y1);pause(0.5);enddelete(hf1);sita1=pi;%ÍíÉÏhf4=fill(r1*cos(t1)+x1,r1*sin(t1)+y1,'b');x11=-8;hf41=fill(r1*cos(t1)+x11,r1*sin(t1)+y1,'k');fori=0:6;%wanshangtc=rand(1,3);title('ÈÕ¸´Ò»ÈÕ£¬Ð¡Ê÷ÂýÂýÂýÂýµØ³¤´ó¡£¡£¡£¡£','color',tc,'fontweight','bold');set(gcf,'color','k');x2=0;y2=0;r2=9;x1=r2*cos(sita1-pi/6*i)+x2;x11=8*cos(sita1-pi/6*i)+x2;y1=r2*sin(sita1-pi/6*i)+y2;set(hf4,'xdata',r1*cos(t1)+x1,'ydata',r1*sin(t1)+y1);set(hf41,'xdata',r1*cos(t1)+x11,'ydata',r1*sin(t1)+y1);pause(0.5);enddelete(hf4);delete(hf41);delete(hf2);%Ê÷Éú³¤delete(hf3);hf5=fill([-1.2-1.21.21.2],[-10-7-7-10],'y');hf6=fill([-2.502.5],[-7-4.5-7],'g');hf7=fill([-202],[-4.5-2.5-4.5],'g');hf1=fill(r1*cos(t1)+x1,r1*sin(t1)+y1,'r');%µÚ¶þÌì°×Ììi=0;sita1=pi;fori=0:6;tc=rand(1,3);title('ÈÕ¸´Ò»ÈÕ£¬Ð¡Ê÷ÂýÂýÂýÂýµØ³¤´ó¡£¡£¡£¡£','color',tc,'fontweight','bold');set(gcf,'color','w');x2=0;y2=0;r2=9;x1=r2*cos(sita1-pi/6*i)+x2;y1=r2*sin(sita1-pi/6*i)+y2;set(hf1,'xdata',r1*cos(t1)+x1,'ydata',r1*sin(t1)+y1);pause(0.5);enddelete(hf1);i=0;sita1=pi;%µÚ¶þÌìÍíÉÏhf4=fill(r1*cos(t1)+x1,r1*sin(t1)+y1,'b')x11=-8;hf41=fill(r1*cos(t1)+x11,r1*sin(t1)+y1,'k');fori=0:6;%wanshangtc=rand(1,3);title('ÈÕ¸´Ò»ÈÕ£¬Ð¡Ê÷ÂýÂýÂýÂýµØ³¤´ó¡£¡£¡£¡£','color',tc,'fontweight','bold');set(gcf,'color','k');x2=0;y2=0;r2=9;x1=r2*cos(sita1-pi/6*i)+x2;x11=8*cos(sita1-pi/6*i)+x2;y1=r2*sin(sita1-pi/6*i)+y2;set(hf4,'xdata',r1*cos(t1)+x1,'ydata',r1*sin(t1)+y1);set(hf41,'xdata',r1*cos(t1)+x11,'ydata',r1*sin(t1)+y1);pause(0.5);enddelete(hf5);%Ê÷Éú³¤delete(hf6);delete(hf7);hf8=fill([-1.4-1.41.41.4],[-10-6-6-10],'y');hf9=fill([-303],[-6-3-6],'g');hf10=fill([-2.502.5],[-3-0.5-3],'g');hf11=fill([-202],[-0.51.5-0.5],'g');hf99=hf9;hf1010=hf10;hf1111=hf11;delete(hf4);delete(hf41);pause(1);hf1=fill(r1*cos(t1)+x1,r1*sin(t1)+y1,'r');i=0;sita1=pi;fori=0:6;tc=rand(1,3);a=title('¾¹ýÁ˺ܶàºÜ¶àÄ꣬Ê÷ÖÕÓÚ³¤³ÉÁËһƬÉÁÖ','color',tc,'fontweight','bold');set(gcf,'color','w');x2=0;y2=0;r2=9;x1=r2*cos(sita1-pi/6*i)+x2;y1=r2*sin(sita1-pi/6*i)+y2;set(hf1,'xdata',r1*cos(t1)+x1,'ydata',r1*sin(t1)+y1);forj=0:3s=randint(1,1,[-1-3*j,1+3*j]);hf5=fill([-1.2+s-1.2+s1.2+s1.2+s],[-10-7-7-10],'y');hf6=fill([-2.5+s0+s2.5+s],[-7-4.5-7],'g');hf7=fill([-2+s0+s2+s],[-4.5-2.5-4.5],'g');pause(0.2);hf8=fill([-1.4+s-1.4+s1.4+s1.4+s],[-10-6-6-10],'y');hf9=fill([-3+s0+s3+s],[-6-3-6],'g');hf10=fill([-2.5+s0+s2.5+s],[-3-0.5-3],'g');hf11=fill([-2+s0+s2+s],[-0.51.5-0.5],'g');h6(i+1,j+1)=hf6;h7(i+1,j+1)=hf7;h9(i+1,j+1)=hf9;h10(i+1,j+1)=hf10;h11(i+1,j+1)=hf11;endpause(0.5);enddelete(hf1);delete(a);W=fill([-10-101010],[-101010-10],'k');X=text(-4,4,'È»','color','r','fontsize',30);pause(1);Y=text(2,4,'¶ø','color','r','fontsize',30);pause(1);Z1='ÀûÒæ³å»èÁËÎÒÃǵÄÍ·ÄÔ';fori=1:10Z(i)=text(-10+i*1.7,-4,Z1(i),'color','r','fontsize',30);pause(0.5);endpause(1);delete(X);delete(Y);delete(Z);delete(W);hf1=fill(r1*cos(0)+x1,r1*sin(0)+y1,'r');delete(h11);pause(0.4);delete(h10);pause(0.4);delete(h9);pause(0.4);delete(h7);pause(0.4);delete(h6);pause(1);delete(hf99);delete(hf1010);delete(hf1111);pause(2);W=fill([-10-101010],[-101010-10],'k');Z2='±£»¤Ê÷ľ£¬±£ÎÀÎÒÃǵļÒÔ°!';fori=1:13text(-8+i*2-13*(i5),4+(i5)*(-8),Z2(i),'color','w','fontsize',30);pause(0.5);end
本文标题:matlab动画制作源代码
链接地址:https://www.777doc.com/doc-2156562 .html