필터 지우기
필터 지우기

How can I find the coefficients of this polynomial?

조회 수: 2 (최근 30일)
Boran Kolcu
Boran Kolcu 2020년 11월 17일
댓글: Boran Kolcu 2020년 11월 17일
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.

답변 (1개)

Stephan
Stephan 2020년 11월 17일
편집: Stephan 2020년 11월 17일
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
John D'Errico
John D'Errico 2020년 11월 17일
Probably should not do what is clearly homework, with no effort made by the poster.
Boran Kolcu
Boran Kolcu 2020년 11월 17일
it works, thans ever so much!

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

카테고리

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