close all
clear all   %START


%%%%%%%%%%%%%%%%%%%%%%%% LOADING DATA %%%%%%%%%%%%%%%%%%%%%%%%

N_frame = 200;
% Number of frames

aviobj = avifile('example_16.avi');
aviobj.quality = 90;
aviobj.compression = 'NONE';
aviobj.fps = 10;

% Create MOVIE property

for ind_frame = 1:N_frame,
 
    name_counter = num2str(ind_frame);
    file_name = strcat('pv_pert_',name_counter);
    
    % aviobj = addframe(aviobj,frame);
    image_full = imread(file_name,'jpg');
    image_frame.cdata = image_full(31:850,101:1120,:);
    image_frame.colormap = [];

    aviobj = addframe(aviobj,image_frame);
    
   
end

aviobj = close(aviobj);
% close AVI file


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



