clear all, close all, clc
load VORTALL;
% VORTALL contains flow fields reshaped into column vectors
X = VORTALL;
L = size(X,2);


% open the videowriter object
v = VideoWriter('cylinder','MPEG-4');
open(v);



% set up the axes
tmp = reshape(X(:,1),199,449);
imagesc(tmp), colormap jet;
axis tight manual
set(gca,'NextPlot','replacechildren')






% capture all the animation frames
for k = 1:L
    tmp = reshape(X(:,k),199,449);
    imagesc(tmp), colormap jet;
    frame = getframe(gcf);
    writeVideo(v,frame);
end



% close the writer
close(v);




