Index: scripts/general/interp1.m =================================================================== RCS file: /cvs/octave/scripts/general/interp1.m,v retrieving revision 1.4 diff -u -r1.4 interp1.m --- scripts/general/interp1.m 1 Mar 2007 15:57:50 -0000 1.4 +++ scripts/general/interp1.m 1 Jun 2007 06:59:02 -0000 @@ -196,6 +196,7 @@ elseif (strcmp (method, "linear")) dy = y(2:ny,:) - y(1:ny-1,:); dx = x(2:nx) - x(1:nx-1); + if (!(all(dx(:)>0) || all(dx(:)<0))) error("interp1: X must be strictly monotonic"); endif if (pp) yi = mkpp (x, [dy./dx, y(1:end-1)], szy(2:end)); else