function coeff=fittyline() 
% fittyline computes a function that maps sonar readings to distances in mm
load sonarcal.ext;
rulerm = sonarcal(:,1);
sonarm = sonarcal(:,2);
[coeff,errstr] = polyfit(sonarm,rulerm,1);
sonaradj = coeff(1)*sonarm+coeff(2);
%figure(1);
%plot(sonarm,rulerm,'b',sonarm,sonaradj,'r.');
%xlabel('value returned by sonar');
%ylabel('ruler measurement, predicted');
