Piecewise Cubic Hermite Interpolating Polynomial (PCHIP)
조회 수: 7 (최근 30일)
이전 댓글 표시
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
채택된 답변
Richard Brown
2013년 6월 14일
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?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Polynomials에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!