フィルターのクリア

How can I fit a curve at the bottom of the plot below?

1 回表示 (過去 30 日間)
Stephen Tete
Stephen Tete 2023 年 7 月 4 日
編集済み: Stephen Tete 2023 年 7 月 4 日
I have the attached dataset and I want to fit a curve at the bottom of the curve. See the attached photo. The original data is in blue and the fit is that in black.
Sample data is attached. Thank you in advance

採用された回答

Matt J
Matt J 2023 年 7 月 4 日
編集済み: Matt J 2023 年 7 月 4 日
You can use boundary,
y=readmatrix('data.txt');
x=(1:numel(y))';
k=boundary(x([1:end,1]), y([1:end,1]));
k=k(diff(k)>0);
plot(x,y, x(k),y(k))
  5 件のコメント
Matt J
Matt J 2023 年 7 月 4 日
Ok, but what help do you still require? As you can see below, the recommendations from my last comment work for y.txt as well.
[~,y]=readvars('y.txt');
x=(1:numel(y))';
S=[1,0.7,0];
for s=S
k=boundary(x([1:end,1]), y([1:end,1]),s);
k=k(diff(k)>0);
plot(x(k),y(k),'-.');hold on
end;
legend("s="+S); xlim([100,400])
Stephen Tete
Stephen Tete 2023 年 7 月 4 日
編集済み: Stephen Tete 2023 年 7 月 4 日
works great when s=0, Thank you very much

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

タグ

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by