I have x and y. Image attached
How can I do at least three different curve fits that are appropriate for the data?
data no noise.PNG

1 件のコメント

dpb
dpb 2018 年 11 月 16 日
Start by plotting...sounds like homework???

サインインしてコメントする。

 採用された回答

KSSV
KSSV 2018 年 11 月 17 日

0 投票

Take this as a demo example. In T and mu, you have to enter your data. Read about plot and polyfit.
T = linspace(0,4*pi,10);
mu = sin(T);
% Use polyfit to fit polynomial to the points.
T1 = linspace(min(T),max(T));
figure
hold on
plot(T,mu)
for n = 1:3
p = polyfit(T,mu,n);
% Evaluate the polynomial on a finer grid and plot the results.
mu1 = polyval(p,T1);
plot(T1,mu1)
end
legend({'Original','n = 1 fit','n = 3 fit','n = 3 fit',})

1 件のコメント

Abraham
Abraham 2018 年 11 月 17 日
Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

質問済み:

2018 年 11 月 16 日

コメント済み:

2018 年 11 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by