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
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/972900/image.png)
댓글 수: 3
채택된 답변
John D'Errico
2022년 4월 21일
Easy.
- Use findpeaks, to locate the sequence of points that represent the successive maxima of the curve.
- Use an interpolating spline to then interpolate those points. A tool like interp1 will be simplest. Specify the 'pchip' option.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!