Matlab中使用Plot函数动画图方法.docxVIP

  • 61
  • 0
  • 约4.12千字
  • 约 7页
  • 2019-01-01 发布于浙江
  • 举报
Matlab中使用Plot函数动画图方法

%% %先画好,然后更改坐标系 %在命令行中 使用 Ctrl+C 结束 t=0:0.1:100*pi; m=sin(t); plot(t,m); x=-2*pi; axis([x,x+4*pi,-2,2]); grid on while 1 if xmax(t) break; end x=x+0.1; axis([x,x+4*pi,-2,2]); %移动坐标系 pause(0.1); end %% % Hold On 法 % 此种方法只能点,或者分段划线 hold off t=0; m=0; t1=[0 0.1]; %要构成序列 m1=[sin(t1);cos(t1)]; p = plot(t,m,*,t1,m1(1,:),-r,t1,m1(2,:),-b,MarkerSize,5); x=-1.5*pi; axis([x x+2*pi -1.5 1.5]); grid on; for i=1:100 hold on t=0.1*i; %下一个点 m=t-floor(t); t1=t1+0.1; %下一段线(组) m1=[sin(t1);cos(t1)]; p = plot(t,m,*,t1,m1(1,:),-r,t1,m1(2,:),-b,MarkerSize,5); x=x+0.1; axis([x

文档评论(0)

1亿VIP精品文档

相关文档