%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% BFLH, GLUU for DH121412.  GLUU clearly better than GMED, SMEM on
% a little longer than BFLH in early stance but BFLH consistently
% better signal.

% SMEM, GLUU for JB011613.  Not a big difference between SMEM and BFLH

% BFLH, GMED for MC121812.  SOL, ADDM, SMEM, BFSH, RF electrodes no good for walk200.

% SMEM, GLUU for BC011113.  BFLH appears to activate in mid-stance 
% (with gastroc), which is interesting.

% for BFLH, GLUU for DC011413.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Use discarded GC's from the first two processing types.
% Run once with first proc, once with second proc (below).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

subjects = {'JB011613'};
%subjects = {'DH121412';'MC121812';'JB011613';'BC011113';'DC011413'};
%proc = {'low100_mvc_sh'};
%proc = {'sang_mvc_sh'};

%proc = {'low100_fw_sh';'low100_mvc_lo';'low100_fw_lo';'low100_mvc_sh'};
%proc = {'sang_fw_sh';'sang_mvc_lo';'sang_fw_lo';'sang_mvc_sh'};
proc = {'low100_fw_sh';'low100_mvc_lo';'low100_fw_lo';'low100_mvc_sh';'sang_fw_sh';'sang_mvc_lo';'sang_fw_lo';'sang_mvc_sh'};
speeds = {'200';'075';'100';'125';'150';'110'};

for i = 1:size(subjects,1)
  for j = 1:size(proc,1)
    for k = 1:size(speeds,1)
      if (strcmp(proc{j},'low100_mvc_sh')+strcmp(proc{j},'sang_mvc_sh')) > 0
        enter_gc = 0;
      else
        enter_gc = 1;
      end;
      %eval(['comb_avg_click(''walk' speeds{k} ''',''' subjects{i} ''',''' proc{j} ''',100,1,enter_gc);']);      
      %eval(['comb_avg_click(''walk' speeds{k} ''',''' subjects{i} ''',''' proc{j} ''',100,1,1,1,1);']);  MC
      eval(['comb_avg_click(''walk' speeds{k} ''',''' subjects{i} ''',''' proc{j} ''',100,2,1,0,0);']);  JB
      %eval(['comb_avg_click(''walk' speeds{k} ''',''' subjects{i} ''',''' proc{j} ''',100,1,1,1,0);']);  DH            
    end;
  end;  
end;

return;

for l = 1:size(proc,1)
  if (strcmp(proc{l},'low100_fw_sh')+strcmp(proc{l},'sang_fw_sh')) > 0
    enter_gc = 0;
  else
    enter_gc = 1;
  end;
  eval(['comb_avg_click(''walk115'',''DH121412'',''' proc{l} ''',100,1,enter_gc);']);  
end;
for m = 1:size(proc,1)
  if (strcmp(proc{m},'low100_fw_sh')+strcmp(proc{m},'sang_fw_sh')) > 0
    enter_gc = 0;
  else
    enter_gc = 1;
  end;
  eval(['comb_avg_click(''walk133'',''DH121412'',''' proc{m} ''',100,1,enter_gc);']);  
end;
for n = 1:size(proc,1)
  if (strcmp(proc{n},'low100_fw_sh')+strcmp(proc{n},'sang_fw_sh')) > 0
    enter_gc = 0;
  else
    enter_gc = 1;
  end;
  eval(['comb_avg_click(''walk137'',''DH121412'',''' proc{n} ''',100,1,enter_gc);']);  
end;
for p = 1:size(proc,1)
  if (strcmp(proc{p},'low100_fw_sh')+strcmp(proc{p},'sang_fw_sh')) > 0
    enter_gc = 0;
  else
    enter_gc = 1;
  end;
  eval(['comb_avg_click(''walk146'',''MC121812'',''' proc{p} ''',100,1,enter_gc);']);  
end;
for v = 1:size(proc,1)
  if (strcmp(proc{v},'low100_fw_sh')+strcmp(proc{v},'sang_fw_sh')) > 0
    enter_gc = 0;
  else
    enter_gc = 1;
  end;
  eval(['comb_avg_click(''walk110'',''JB011613'',''' proc{v} ''',100,1,enter_gc);']);  
end;
for q = 1:size(proc,1)
  if (strcmp(proc{q},'low100_fw_sh')+strcmp(proc{q},'sang_fw_sh')) > 0
    enter_gc = 0;
  else
    enter_gc = 1;
  end;
  eval(['comb_avg_click(''walk133'',''BC011113'',''' proc{q} ''',100,1,enter_gc);']);  
end;
for u = 1:size(proc,1)
  if (strcmp(proc{u},'low100_fw_sh')+strcmp(proc{u},'sang_fw_sh')) > 0
    enter_gc = 0;
  else
    enter_gc = 1;
  end;
  eval(['comb_avg_click(''walk153'',''DC011413'',''' proc{u} ''',100,1,enter_gc);']);  
end;
