
maxdepth=[];
for ii = 1:13
  ii
  if ii < 10
    eval(['load SAM_00',int2str(ii),'_fl'])
  else
    eval(['load SAM_0',int2str(ii),'_fl'])
  end
	  
  maxdepth(ii) = max(press);
    
  if ii < 10
    eval(['load SAM_00',int2str(ii),'_down'])
  else
    eval(['load SAM_0',int2str(ii),'_down'])
  end
  if max(press) > maxdepth(ii)
    maxdepth(ii)=max(press);
  end    

  if ii < 10
    eval(['load SAM_00',int2str(ii),'_up'])
  else
    eval(['load SAM_0',int2str(ii),'_up'])
  end
  if max(press) > maxdepth(ii)
    maxdepth(ii)=max(press);
  end    
end

fid=fopen('maxdepth.txt','w');
fprintf(fid,'     sled    max depth\n')
fprintf(fid,'     cast  \n')

for ii = 1:13
  fprintf(fid,'     %d     %f\n',ii,maxdepth(ii));
end