%  (Broken) script to check for problems with meter readings

%        meter no.  10/21     10/24     10/31     11/02
readings = [1486   3643.97   5949.58   7432.27   0681.89;
	   1785   2456.60   2624.19   5790.94   6150.65;
	   1656   1184.35   2119.87   8496.63   7965.04;
	   1090   0318.86   5723.17   6719.98   6946.79;
	   1241   0333.90   2164.50   4019.79   4019.79;
           1649   0932.02   7390.30   3595.83   6348.47];

(rows cols) = size(readings);

for R = 1 to rows
  serial = readings(1,R);
  present = readings(r,cols+1);
  past = readings(r,cols);
  if past > present 
      fprintf(Check meter no. %i (went from %past back to %present)\n, serial, past, present);
  ifelse past = present
      fprintf('Meter no. %i remained at %f.\n', meter, present)
  endif
R = R + 1;
end
