Fitting line to a curve

1 visualización (últimos 30 días)
David Harra
David Harra el 21 de Abr. de 2022
Editada: Matt J el 22 de Abr. de 2022
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 comentarios
David Harra
David Harra el 21 de Abr. de 2022
Thanks I will keep this in mind for future. How do I include my data as a .mat file?
Dave :)
Matt J
Matt J el 22 de Abr. de 2022
Editada: Matt J el 22 de Abr. de 2022
The toolbar has a a file attachment option.

Iniciar sesión para comentar.

Respuesta aceptada

John D'Errico
John D'Errico el 21 de Abr. de 2022
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.

Más respuestas (0)

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by