% this function reads the files from a directory
%inputs: myfolder: is the address of the file and the file type in the
%directory 
% num_samples is the number of samples for each point
% [filenames] is the 2-D arrays with (number of files / num_samples) rows
% and num_samples columns 
function [filenames] = readDir(myfolder, num_samples)

files = dir(myfolder);

filesArray = struct2cell(files);

[m, n] = size(filesArray);
k=1;
for i = 1: n/num_samples 
    
    for j= 1: num_samples
        
    filenames(i, j) = filesArray(1, k);
    k = k +1; 
    end
    
end
