how can ı solve without curve fitting?

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 日

1 投票

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 件のコメント

matlab coder
matlab coder 2021 年 1 月 25 日
isnt polyfit a curve fitting funnction? ı want to solve it without using curve fitting?
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 件)

カテゴリ

ヘルプ センター および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

タグ

質問済み:

2021 年 1 月 25 日

コメント済み:

2021 年 1 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by