clear all
close all

olddir = pwd;
cd 'C:\Documents and Settings\Anders\Desktop\timelapse\1024'


maxN=566;

mov=avifile('test566.avi','FPS',15);

for n=1:maxN
    fname=strcat('IMG_',num2str(n+7164),'.JPG')
    a=imread(fname,'JPEG');
    image(a);
    axis off
    truesize
    F=getframe(gca);
    mov=addframe(mov,F);
end
mov=close(mov);


cd(olddir)