firstfile=1;
lastfile=9;
lf=50;
hf=150;
timelength=.15;

for file=firstfile:lastfile
  filename=[num2str(file),'.dat'];
  pdfname=[num2str(file),'.pdf'];
  clf;
  seg2plot(filename,timelength,lf,hf);
  orient landscape;
  print('-dpdf',pdfname);
end

