《img widt heigh /》
clc;clear;h = animatedline;xl=xlabel(‘cos(omegat)’);% yl=ylabel(‘sin(omegat)’);% grid on;title(‘omega = 1rad/s Made by J Pan’)axis([-1,1,-1,1]);axis square;N = 100;t=linspace(0,2*pi,N);w=1;x=cos(w*t);y=sin(w*t);a = tic; % start timerfor k = 1:N addpoints(h,x(k),y(k)); hold on quiver(0,0,x(k)*1.1,y(k)*1.1) b = toc(a); % check timer if b 》 (1/90) drawnow % update screen every 1/30 seconds a = tic; % reset timer after updating endend
《img widt heigh /》
clc;clear;h = animatedline;xl=xlabel(‘cos(omegat)’);% yl=ylabel(‘sin(omegat)’);% grid on;title(‘omega = 1rad/s Made by J Pan’)axis([-1,1,-1,1]);axis square;N = 100;t=linspace(0,2*pi,N);w=1;x=cos(w*t);y=sin(w*t);a = tic; % start timerfor k = 1:N addpoints(h,x(k),y(k)); hold on quiver(0,0,x(k)*1.1,y(k)*1.1) b = toc(a); % check timer if b 》 (1/90) drawnow % update screen every 1/30 seconds a = tic; % reset timer after updating endend