function just_one(subject1,subject2,file1,muscle1,method)

addpath './PolyfitnTools/PolyfitnTools';

muscles = {'TA';'SOL';'GAS';'VAS';'BFSH';'RF';'HAM';'ILL';'GLU';'HAB';'ADDL';'ADDM'};

eval(['load ~/Documents/MATLAB/data/' subject1 '/processed/mot/mat/all/' file1 '.mat;']);

eval(['aa1 = m_ankle_ang_' lower(EMGleg)  '*pi/180;']);
eval(['ka1 = m_knee_ang_' lower(EMGleg)  '*pi/180;']);
eval(['ha1 = m_hip_ang_' lower(EMGleg)  '*pi/180;']);

eval(['am1 = m_ankle_mom_' lower(EMGleg)  '/mass/9.81/leg_lengths.' upper(EMGleg) ';']);
eval(['km1 = m_knee_mom_' lower(EMGleg)  '/mass/9.81/leg_lengths.' upper(EMGleg) ';']);
eval(['hm1 = m_hip_mom_' lower(EMGleg)  '/mass/9.81/leg_lengths.' upper(EMGleg) ';']);

eval(['load ~/Documents/MATLAB/data/' subject1 '/processed/EMG/avg_act_thresh/' method '/' file1 '.mat;']);

proc_lmtc = whos('m_*len');

for k = 1:length(proc_lmtc)
  eval([proc_lmtc(k).name(3:end) '1 = ' proc_lmtc(k).name ';']);
  eval(['d' proc_lmtc(k).name(3:end) '1 = [(diff(' proc_lmtc(k).name ')/.01) 0];']);  
end;

for i = 1:length(muscles)
  eval(['a' muscles{i} '1 = m_a' muscles{i} ';']);
  eval(['clear a' muscles{i} ';']);
  eval(['clear s' muscles{i} ';']);  
end;

clear m_* sd_* n_*

eval(['load ~/Documents/MATLAB/data/' subject2 '/processed/mot/mat/all/' file1 '.mat;']);

eval(['aa2 = m_ankle_ang_' lower(EMGleg)  '*pi/180;']);
eval(['ka2 = m_knee_ang_' lower(EMGleg)  '*pi/180;']);
eval(['ha2 = m_hip_ang_' lower(EMGleg)  '*pi/180;']);

eval(['am2 = m_ankle_mom_' lower(EMGleg) '/mass/9.81/leg_lengths.' upper(EMGleg) ';']);
eval(['km2 = m_knee_mom_' lower(EMGleg) '/mass/9.81/leg_lengths.' upper(EMGleg) ';']); 
eval(['hm2 = m_hip_mom_' lower(EMGleg) '/mass/9.81/leg_lengths.' upper(EMGleg) ';']); 

eval(['load ~/Documents/MATLAB/data/' subject2 '/processed/EMG/avg_act_thresh/' method '/' file1 '.mat;']);

proc_lmtc = whos('m_*len');

for l = 1:length(proc_lmtc)
  eval([proc_lmtc(l).name(3:end) '2 = ' proc_lmtc(l).name ';']);  
  eval(['d' proc_lmtc(l).name(3:end) '2 = [(diff(' proc_lmtc(l).name ')/.01) 0];']);  
end;

for j = 1:length(muscles)
  eval(['a' muscles{j} '2 = m_a' muscles{j} ';']);
  eval(['clear a' muscles{j} ';']);
  eval(['clear s' muscles{j} ';']);  
end;

clear m_* sd_* n_*
keyboard
if strcmp(muscle1,'TA') == 1

  ncoeff = polyfitn([-am2' tib_ant_len2' soleus_len2' gas_med_len2' dtib_ant_len2' dsoleus_len2' dgas_med_len2' aGAS2' aSOL2'],aTA2',2);

  scale1 = max([-am2' tib_ant_len2' soleus_len2' gas_med_len2' dtib_ant_len2' dsoleus_len2' dgas_med_len2' aGAS2' aSOL2'])./max([-am1' tib_ant_len1' soleus_len1' gas_med_len1' dtib_ant_len1' dsoleus_len1' dgas_med_len1' aGAS1' aSOL1']);
  
  figure
  plot(aTA2,'linewidth',2)
  hold on;
  plot(polyvaln(ncoeff,[-am2' tib_ant_len2' soleus_len2' gas_med_len2' dtib_ant_len2' dsoleus_len2' dgas_med_len2' aGAS2' aSOL2']),'r','linewidth',2);
  plot(aTA1)
  plot(polyvaln(ncoeff,(ones(101,1)*scale1).*[-am1' tib_ant_len1' soleus_len1' gas_med_len1' dtib_ant_len1' dsoleus_len1' dgas_med_len1' aGAS1' aSOL1']),'r');
  grid on;  

  keyboard

  %ncoeff = polyfitn([aa2' am2' aGAS2' aSOL2'],aTA2',2);

  %lcoeff = [aa2' am2' aGAS2' aSOL2']\aTA2';
  
  figure
  plot(polyvaln(ncoeff,[aa2' am2' aGAS2' aSOL2']),'r')
  hold on;
  plot(lcoeff'*transpose([aa2' am2' aGAS2' aSOL2']),'g');
  plot(aTA2');

  keyboard
  plot(polyvaln(ncoeff,[aa1' am1' aGAS1' aSOL1']),'k')
  plot(lcoeff'*transpose([aa1' am1' aGAS1' aSOL1']),'c');
  
  
end;  


ncoeff = polyfitn([aSOL2' aGAS2' aVAS2' aBFSH2' aHAM2' aGLU2' aHAB2'],aTA2',2); 
plot(polyvaln(ncoeff,[aSOL2' aGAS2' aVAS2' aBFSH2' aHAM2' aGLU2' aHAB2']),'r')
hold on;
plot(aTA2)
plot(polyvaln(ncoeff,[aSOL1' aGAS1' aVAS1' aBFSH1' aHAM1' aGLU1' aHAB1']),'r')


lcoeff = [aSOL2' aGAS2' aVAS2' aHAM2' aBFSH2' aGLU2' aHAB2']\aTA2';
plot(lcoeff'*transpose([aSOL2' aGAS2' aVAS2' aHAM2' aBFSH2' aGLU2' aHAB2']))
hold on
plot(aTA2,'r')
plot(lcoeff'*transpose([aSOL1' aGAS1' aVAS1' aHAM1' aBFSH1' aGLU1' aHAB1']),'g')





if strcmp(muscle1,'RF') == 1

  ncoeff = polyfitn([ka2' ha2' km2' hm2' aHAM2' aVAS2' aGLU2'],aRF2',2);

  lcoeff = [ka2' ha2' km2' hm2' aHAM2' aVAS2' aGLU2']\aRF2';
  
  figure
  plot(polyvaln(ncoeff,[ka2' ha2' km2' hm2' aHAM2' aVAS2' aGLU2']),'r')
  hold on;
  plot(lcoeff'*transpose([ka2' ha2' km2' hm2' aHAM2' aVAS2' aGLU2']),'g');
  plot(aRF2');
  plot(polyvaln(ncoeff,[ka1' ha1' km1' hm1' aHAM1' aVAS1' aGLU1']),'k')
  plot(lcoeff'*transpose([ka1' ha1' km1' hm1' aHAM1' aVAS1' aGLU1']),'c');
  plot(aRF1,'linewidth',2)
  
end;  