Fitting line to a curve
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
John D'Errico
il 21 Apr 2022
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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Interpolation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!