필터 지우기
필터 지우기

how can ı solve without curve fitting?

조회 수: 2 (최근 30일)
matlab coder
matlab coder 2021년 1월 25일
댓글: matlab coder 2021년 1월 25일
Consider the given xy-data. x=0:5; y=[15, 10, 9, 6, 2, 0];. Write the necessary commands to obtain the equation of a 4th order polynomial (y = a0 + a1 x + a2 x 2 + a 3 x 3 + a 4 x 4 ) that can be fitted to these data. Note that the polynomial should pass trough the data points.... I solve this question with matlab curve fitiing function but ıs there any other way to solve?

채택된 답변

KSSV
KSSV 2021년 1월 25일
Read about polyfit.
x=0:5;
y=[15, 10, 9, 6, 2, 0];
p = polyfit(x,y,4) ;
xi = 0:0.1:5 ;
plot(x,y,'or',xi,polyval(p,xi))
  댓글 수: 3
KSSV
KSSV 2021년 1월 25일
Yes, it is a curve fitting....you can have a look on the function spline.
plot(x,y,'ok',xi,spline(x,y,xi),'r')
matlab coder
matlab coder 2021년 1월 25일
but ı said ı dont want it to be solved with curve fitting :) ? ıs there any other way ?

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by