maxFile=5;

% addpath('/home/hohlochj/masterarbeit/usedMcode')
% pathToFile='/nfs/wsi/ti/messor/hohlochj/origData/';
pathToFile='/home/jph/Uni/masterarbeit/Block1_ReachingMovements/';

[subjects,numbers]=namesAndNumbers(strcat(pathToFile,'dirs.txt'));

tmp=cell([maxFile,1]);

for i=1:size(subjects,2)
    subject=subjects{i};
    for number=numbers{i}
        parfor j=1:maxFile
            tmp{j}=csvread(strcat(pathToFile,sprintf('kin/%s_B1S00%iR0%i.txt',subject,number,j)),1,0);
            tmp{j}=tmp{j}(:,1:4);
        end
        eval(sprintf('kin%s%i = tmp;',subject,number));
    end
end

save(strcat(pathToFile,'kinematics.mat'))