Effacer les filtres
Effacer les filtres

How can I find the coefficients of this polynomial?

2 vues (au cours des 30 derniers jours)
Boran Kolcu
Boran Kolcu le 17 Nov 2020
Commenté : Boran Kolcu le 17 Nov 2020
I need to find the coefficients of the polynomial that passes through the points (0, 10), (1, 35), (3, 31) and (4, 2).
I appreciate it a lot if anyone can help.

Réponses (1)

Stephan
Stephan le 17 Nov 2020
Modifié(e) : Stephan le 17 Nov 2020
x = [0 1 3 4];
y = [10 35 31 2];
coeffs = polyfit(x,y,3)
plot(0:0.1:5,polyval(coeffs,0:0.1:5),'b-')
hold on
scatter(x,y,'bo')
hold off
  2 commentaires
John D'Errico
John D'Errico le 17 Nov 2020
Probably should not do what is clearly homework, with no effort made by the poster.
Boran Kolcu
Boran Kolcu le 17 Nov 2020
it works, thans ever so much!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Polynomials dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by