Reputation: 1
I am trying to do a pchip interpolation in MATLAB. The interpolation works fine, but when I use the ppval function to check the curve (for plotting) I get an error message, and I cannot figure out what the problem is.
I have previously used the pchip function in this way: yi = pchip(x,y,xi), and that worked ok. However, I now want only the coefficients (pp.coefs). The problem is that they seem to make no sense when I try to check them with the ppval function.
This is an example:
x = [1.4771 1.9031 2.3802 2.9031 3.3979];
y = [6.1727 5.1242 3.4537 1.8528 0];
pp = pchip(x,y);
xs = linspace(x(1),x(end),200);
yy = ppval(pp.coefs,xs);
Error using unmkpp (line 19)
The input array does not seem to describe a pp function.
Error in ppval (line 63)
[b,c,l,k,dd]=unmkpp(pp);`
Can anyone help me figure out where I am doing something wrong? Thanks!
Upvotes: 0
Views: 2059