Fitting line to a curve

1 回表示 (過去 30 日間)
David Harra
David Harra 2022 年 4 月 21 日
編集済み: Matt J 2022 年 4 月 22 日
I have a plot of attenuation V frequency and I am wondering if there is a way I can fit a straight line the follows the upper trajectory of the graph, so that you would see the line increase and then level off. I have tried a few methods but getting lines through the middle etc. Many Thanks
  3 件のコメント
David Harra
David Harra 2022 年 4 月 21 日
Thanks I will keep this in mind for future. How do I include my data as a .mat file?
Dave :)
Matt J
Matt J 2022 年 4 月 22 日
編集済み: Matt J 2022 年 4 月 22 日
The toolbar has a a file attachment option.

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

採用された回答

John D'Errico
John D'Errico 2022 年 4 月 21 日
Easy.
  1. Use findpeaks, to locate the sequence of points that represent the successive maxima of the curve.
  2. Use an interpolating spline to then interpolate those points. A tool like interp1 will be simplest. Specify the 'pchip' option.

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by