How to calculate polynomial coefficient in this case?

조회 수: 2 (최근 30일)
Chaou
Chaou 2013년 5월 28일
Hollo. I want to formulate P(x) as a polynomial function,
So: P(x) = C1 + C2 * X + C3 * X^2 + C4 * X^3 + C5 * X^4 ...... + Cn * X^n-1.
How do I do to obtain C1, C2, C3, C4, ........... Cn ?
Knowing that (for example):
P(1)=1
P(2)=3
P(3)=9
. . . . P(10)=1200... etc.
Thanks!

답변 (2개)

Matt J
Matt J 2013년 5월 28일
Use POLYFIT
  댓글 수: 1
Matt J
Matt J 2013년 5월 28일
편집: Matt J 2013년 5월 28일
However, a 10-th order polynomial, like in your example, could be hard to fit.

댓글을 달려면 로그인하십시오.


Roger Stafford
Roger Stafford 2013년 5월 28일
편집: Matt J 2013년 5월 29일
Another possibility is to use the Lagrange formulation of the polynomial in symbolic form and then use the Symbolic Toolbox 'collect' function on that expression. Or better still use 'coeffs'. See
Note: With ten points the Lagrange polynomial will admittedly be tedious to construct, but you can do it.

카테고리

Help CenterFile Exchange에서 Polynomials에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by