subjects = ['DS100611';'EM072611';'AD052611';'AM062411']; 

speeds = [75 100 125 150 175 200];

for i = 1:size(subjects,1)
  for j = 1:length(speeds)
    if speeds(j) == 75;
      numstr = '075';
    else
      numstr = num2str(speeds(j));
    end;
    if strcmp(subjects(i,:),'AD052611') == 1
      EMGleg = 'l';
    elseif strcmp(subjects(i,:),'AM062411') == 1
      EMGleg = 'l';
    elseif strcmp(subjects(i,:),'EM072611') == 1  
      EMGleg = 'r';
    elseif strcmp(subjects(i,:),'DS100611') == 1
      EMGleg = 'r';
    else
      fprintf(['Unrecognized subject: ' subjects(i,:) '.\n']);
      return;
    end;
      
    path_full1 = ['~/Documents/MATLAB/data/' subjects(i,:) '/processed/mot/mat/mech/'];
    eval(['load ' path_full1 'walk' numstr '.mat']);
    eval(['load ''~/Desktop/' subjects(i,:) '/walk' numstr '_shnk.mat'';']);
    
    outfile = ['~/Desktop/data/' subjects(i,:) '/walk' numstr '.mat'];
    save(outfile,'EMGleg','*ankle*','endstance*','*hip*','*knee*','*shnk*','mass');
    
  end;  
end;    
    