小人表白MATLAB代码

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

functiongaobaisc=get(0,'ScreenSize');figure('toolbar','none',...'position',[sc(3)/450sc(3)*2/4sc(4)-100],...'name','告白CodebyQIAOXINGXING');set(gca,'position',[0011]);set(gca,'xtick',[],'ytick',[]);holdon;axisequal;axis([-08-.33.3]);degree=pi/180;deg1=[120:-2:60].*degree;deg2=-deg1;t1=linspace(-120,-60,length(deg1))*degree;t2=-pi-t1;u2=[0,0.5,.5*exp(pi/6*i)+.5];h1=plot(0);h2=plot(0);h3=plot(0);h4=plot(1);A=0;forc=0:5forb=1:length(deg1)delete(h1);delete(h2);delete(h3);delete(h4);B=exp(i*deg1(b))+A;C=exp(i*deg2(b))+B;u=[ABC];E=[.3*exp(i.*(-90:270).*degree),-1.3*i];E=E+1.3*i+B;u1=u2*exp(i*t1(b))+.8*i+B;u11=u2*exp(i*t2(b))+.8*i+B;h1=plot(u,'linewidth',3);h2=plot(E,'linewidth',3);h3=plot(u1,'linewidth',3);h4=plot(u11,'linewidth',3);pause(.001)endCC=A;A=C;endpause(.2)t11=[-120:2:-15]*degree;t22=linspace(120,195,length(t11))*degree;ford=1:length(t11)delete(h3);delete(h4);u1=u2*exp(i*t11(d))+.8*i+B;u11=[.5*exp(i*t22(d)),0,.5*exp(-15*i*degree)]-.5*exp(i*t22(d))+.8*i+B;h3=plot(u1,'linewidth',3);h4=plot(u11,'linewidth',3);pause(.001)endhua_t=[-180:9:120]*degree;hua_u=exp(i*hua_t)+2/sqrt(3)*exp(-i*pi/6);hua_u1=hua_u*exp(i*120*degree);hua_u2=hua_u1*exp(i*120*degree);hua_uu=.09*([hua_u,hua_u1,hua_u2,-i*5]+i*5);hua_uu1=u1(3)+hua_uu;t33=[-25:15,15:-1:-25]*degree;foree=1:4ifee==4t33=[-25:3:15,15:-3:-20]*degree;end;fore=1:length(t33)delete(h3);u1=u2*exp(i*t33(e))+.8*i+B;h3=plot(u1,'linewidth',3);pause(.001)endendh5=fill(real(hua_uu1),imag(hua_uu1),'r');h6=plot(hua_uu1,'r','linewidth',3);pause(1)C=CC;t1=[120:-.5:100]*degree;t2=linspace(120,180,length(t1))*degree;t3=linspace(60,0,length(t1))*degree;forf=1:length(t1)delete(h1);delete(h2);delete(h3);delete(h4);delete(h5);delete(h6);A1=.5*exp(i*t1(f))+A;B=.5*exp(i*t2(f))+A1;C1=.5*exp(i*t3(f))+C;u=[AA1BC1C];E=[.3*exp(i.*(-90:270).*degree),-1.3*i];E=E+1.3*i+B;u1=u2*exp(i*t33(e))+.8*i+B;u11=[.5*exp(i*t22(d)),0,.5*exp(-15*i*degree)]-.5*exp(i*t22(d))+.8*i+B;hua_uu1=u1(3)+hua_uu;h1=plot(u,'linewidth',3);h2=plot(E,'linewidth',3);h3=plot(u1,'linewidth',3);h4=plot(u11,'linewidth',3);h5=fill(real(hua_uu1),imag(hua_uu1),'r');h6=plot(hua_uu1,'r','linewidth',3);pause(.001)endpause(1)forg=0:.03:4axis([g8-.33.3]);pause(.01)endpause(2)%逐行逐字输出文字TT={'亲爱的';...'你知道吗';...'自打我那天第一次见你';...'我就把你刻在了心里';...'我渐渐地明白';...'我活着的全部意义';...'就是对你说';...'不!!';...'我要大声地喊出来';...'我喜欢你!!!!!';...};fora=1:length(TT(:,1))T=char(TT(a,:));forb=1:length(T)h(b)=text((4-.32*length(T))/2+b*.32+3.65,3,{T(b)},'color','r',...'fontunits','normalized','fontsize',.1);ifa==length(TT(:,1))pause(.04);elsepause(.13);endendpause(1)ifa==length(TT(:,1))-1pause(3);enddelete(h);h=[];endcol={'y','m','c','r','g','b','k',};forb=1:555s=mod(fix(rand(1)*100),7)+1;x=rand(1)*4+3;y=rand(1)*3;text(x,y,{'我喜欢你'},'color',char(col(s)),...br'fontunits','normalized','fontsize',rand(1)*.17);axis([48-.33.3]);ifb>30pause(.02)ifmod(b,20)==19fx=rand(1)*sc(3)*2/3;fy=rand(1)*sc(4)*2/3;figure('position',[fx,fy,sc(3)/3,sc(4)/3]);set(gca,'position',[0011]);end

1 / 7
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功