small bug fix in ppval

Shai Ayal shaiay at gmail.com
Fri Apr 25 02:17:43 CDT 2008


this is a trivial on-liner. I think lookup was changed recently. Since
I don't know the meaning of the "lr" parameter to lookup I tried to
guess.
This show up in making the doc/interpreter/interpderiv2.eps figure. It
looks right to me with the fix, but please double-check.

Shai


diff --git a/scripts/polynomial/ppval.m b/scripts/polynomial/ppval.m
--- a/scripts/polynomial/ppval.m
+++ b/scripts/polynomial/ppval.m
@@ -39,7 +39,7 @@ function yi = ppval (pp, xi)
     transposed = (columns (xi) == 1);
     xi = xi(:);
     xn = length (xi);
-    idx = lookup (pp.x, xi, "lr");
+    idx = lookup (pp.x(2:end-1), xi)+1;
     dx = (xi - pp.x(idx)).';
     dx = reshape (dx(ones(1,prod(pp.d)),:),[pp.d,xn]);
     c = reshape (pp.P(:,1), pp.n, prod (pp.d));


More information about the Octave-maintainers mailing list