Fitting line to a curve

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Interpolation 的更多信息

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by