Piecewise Cubic Hermite Interpolating Polynomial (PCHIP)
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Richard Brown
le 14 Juin 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?
1 commentaire
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Polynomials dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!