Monday, April 01, 2013

Matlab Movies

Here is a short tutorial on Matlab movies of plots..

figure,for j=1:ctr
plot(x,y(:,j))
axis([xlt xrt ylt yrt])
movielist(j) = getframe(gcf);%%%this gets the entire figure.
end

To simply play the created move 'n' times at the frame rate of 'r' per second:

figure,movie(gcf,movielist,n,r)

To save the movie into an avi file

writerObj = VideoWriter('moviefile.avi');
open(writerObj);
for j=1:ctr
writeVideo(writerObj,movielist(j));end
close(writerObj);