Piecewise Cubic Hermite Interpolating Polynomial (PCHIP)
7 views (last 30 days)
Show older comments
Hello friends
I am doing cubic interpolation for the data x = [5.8808 6.5137 7.1828 7.8953]; y = [31.2472 33.9977 36.7661 39.3567];
pp = pchip(x,y);
Now pp gives coefficients of the polynomials but why they are not satisfying the data points, I am not able to understand, why is it happening like that?
If anyone knows about it, please let me know
Thanks
Bhomik
0 Comments
Accepted Answer
Richard Brown
on 14 Jun 2013
It works perfectly
x = [5.8808 6.5137 7.1828 7.8953];
y = [31.2472 33.9977 36.7661 39.3567];
pp = pchip(x,y);
You could draw a picture
xs = linspace(5, 8, 200);
ys = ppval(pp, xs);
plot(xs, ys, 'b-', x, y, 'ro')
Or test the function values
ppval(pp, x) - y
Where's the problem?
More Answers (0)
See Also
Categories
Find more on Polynomials in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!