What kind of Interpolation Algorithm Will be Applicable for the Following data set to obtain smooth curve?

1 回表示 (過去 30 日間)
Hello there,
I have a following data set,
x =
[443.0000 443.9000 482.0000 496.6000 560.0000 561.4000 654.6000 664.5000 703.9000 740.2000 782.5000 835.1000 864.7000 864.8000 1608.9000 1613.7000 2200.7000 2202.4 ]
y =
[1.0464 1.0641 0.9832 0.9631 0.9370 0.9358 0.9611 0.9574 0.9820 0.9955 1.0287 1.0034 1.0021 1.0063 1.0372 1.0336 1.0343 1.0290 ]
This plot represents the actual data set
Now I was doing shape preserving interpolation
In this case, this type of interpolation following the actual data, At this point I want to perform different interpolation algorithm which helps to smoothing the interpolating data set.
Could you please share any idea?
Thank you.
  1 件のコメント
John D'Errico
John D'Errico 2022 年 10 月 27 日
編集済み: John D'Errico 2022 年 10 月 27 日
If the algorithm changes the data (i.e., smooths it) then it is not interpolation.

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

採用された回答

Bruno Luong
Bruno Luong 2022 年 10 月 27 日
編集済み: Bruno Luong 2022 年 10 月 27 日
It looks like your data has a couples of pairs/tripples that are closely spread.
I suggest to merge thme to a single point then fit the data that are merged.
x = [443.0000 443.9000 482.0000 496.6000 560.0000 561.4000 654.6000 664.5000 703.9000 740.2000 782.5000 835.1000 864.7000 864.8000 1608.9000 1613.7000 2200.7000 2202.4 ];
y = [1.0464 1.0641 0.9832 0.9631 0.9370 0.9358 0.9611 0.9574 0.9820 0.9955 1.0287 1.0034 1.0021 1.0063 1.0372 1.0336 1.0343 1.0290 ];
[xu,~,J]=uniquetol(x,10,'DataScale',1);
xi=linspace(min(x),max(x),500);
yu=accumarray(J(:),y(:),[],@mean);
yi=interp1(xu,yu,xi,'makima');
plot(x,y,'or',xi,yi,'b');
  3 件のコメント
Bruno Luong
Bruno Luong 2022 年 10 月 27 日
You are welcome
PS: I just edit the code to take the average of y before interpolation.
suraj karki
suraj karki 2022 年 10 月 27 日
The second Graphs shows more physical meaning. Thank a lot Burno

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by