clc; clear; fig=figure; aviobj=avifile('e:\role0\1\21.avi'); n=50; x=0:pi/n:2*pi; y=sin(x); k=0; for t=0:pi/n:2*pi k=k+1; x(k)=t; y(k)=sin(t); H=plot(x,y,x(k),y(k),'or'); grid MOV=getframe(fig); aviobj=addframe(aviobj,MOV); end close(fig) aviobj=close(aviobj)
时间: 2024-12-05 09:27:07