How to create a smooth curve through data points?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi, I used an ADV to gather the velocity of water at a depth. I have removed the noisy data and played around with the matlab curve fitting app. However i cannot seem to create a smooth curve going through the data points as one would in excel. I checked the forums aswell and the suggestions do not seem to work. Has anyone got any advice?
Thank you in advance.
Gerard.
0 comentarios
Respuestas (1)
John D'Errico
el 9 de Feb. de 2020
We don't have your data, so I cannot give any examples. As well, I don't know your definition of a smooth curve.
Do you want a curve that smooths out what appears to be noise, yet is fariy simple? In that case, I would use polyfit. Or if you just want a plot, the basic fitting tools on the plot will suffice. A quadratic or possibly a cubic polynomial (at most) fit will suffice. Do not go higher order than that, however, as you will start to get degeneracies, and over fitting.
Do you want a curve that interpolates the points exactly in some way, yet is still smooth. For this, you might want to use an interpolating spline. However it lookes like you MAY have repeated x values, with multiple distinct y values. That will cause problems. And an interpolating spline through data like that will surely look nasty.
Or do you want some sort of smooth curve that follows the points around in the order they are stored? Again, a spline can work here.
Do you want some sort of function you can write down? Or do you just want a nice plot? Do you need to be able to evaluate the function, but not need to write it down?
Regrdless, without your data and knowledge of what you really want out the end, it is difficult to much more. Otherwise I would be forced to write a small book.
Ver también
Categorías
Más información sobre Interpolation en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!