%  LoadCellForce.m
% Finds the max force measured by the load cell 
% and makes an array containing all the force data

clear 
clc

dpath = '134.89.12.189/data/';
dataDirs = dir([dpath 'R*']);

MaxLoadCellForce=[];
LoadCellData=[];
n=1;

for i = 1:length(dataDirs)
  if(dataDirs(i).isdir == 1)
     ppath = [dpath dataDirs(i).name '/'];
     
     matfiles = dir([ppath 'D*.mat'])

     K = length(matfiles);
     for k = 1:K
       k
       load([ppath matfiles(k).name]);
       MaxLoadCellForce(n)=max(LoadCellForce);
       LoadCellData=horzcat(LoadCellData,LoadCellForce);
       n=n+1;
     end
  end
end