% 
% File:   getpoints.m
% Date:   29-Aug-03
% Author: I. Chuang <ichuang@mit.edu>
% 
% Interactively read data points from a plot, by letting the user
% left-click on the plot.  Press the right mouse button to exit.
% 

cnt = 0;
while(1)
  [x,y,button] = ginput(1);
  fprintf(1,'x==%15.8f y=%15.8f',x,y);
  cnt = cnt + 1;
  if(cnt>1)
    fprintf(1,'  delta-x from last = %15.8f',x-xlast);
  end
  xlast = x;
  fprintf(1,'\n');
  if(button~=1)
    break;
  end
end