%tic clear t = 200; t1=t; L=2; N = 160; x(1:2*N) = 0; x(N/2)=2; x(N/2-1)=-2; options = odeset('RelTol',1e-7,'OutputFcn','odeplot','OutputSel',[3 36]); [t x] = ode45('fpuani1', [0:L:t], x, options, N); for H=1:t1/L, EE(H)=0; hh(H)=H*L; hhh=H*L; for J=1:N-1, YY(H,J)=x(H,J); VV(H,J)=x(H,J+1)-x(H,J); %EE(H)=EE(H)+x(H,N+J)^2/2+(x(H,J+1)-x(H,J))^2+(x(H,J+1)-x(H,J))^4/2; end end n=1; fig=figure; set(fig,'DoubleBuffer','on'); set(gca,'NextPlot','replace','Visible','off'); iname=sprintf('mov3333v0.avi', 1) mov = avifile(iname,'fps',10); for count=1:100 h = plot(YY(count,:),'ro-'); shading flat; axis([0 N+2 -4 4]) grid off set(h,'EraseMode','xor'); F = getframe(gca); mov = addframe(mov,F); clear F; clear h; end mov = close(mov); clear mov;