[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
small bug fix in ppval
From: |
Shai Ayal |
Subject: |
small bug fix in ppval |
Date: |
Fri, 25 Apr 2008 10:17:43 +0300 |
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));