Find flattest line from matrix of vectors plotted against x values
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
BOB
el 6 de Feb. de 2019
Comentada: John D'Errico
el 7 de Feb. de 2019
Hi there,
I have a matrix of y-axis coordinates, which I'm plotting against a constant set of x-axis coordinates. I want to determine which of these plotted lines has the flattest line overall, i.e. the line that overall shows the least variation with the x-coordinates.
Can anyone recommend how to do this?
Thanks!
0 comentarios
Respuesta aceptada
Jeff Miller
el 6 de Feb. de 2019
If you want to find the y-matrix row with the least variation, you could simply find the row with the small std, range, or mean absolute deviation of y values. If you want the flattest line in the sense of minimum abs(slope) versus x, you will probably have to fit a line for each row.
1 comentario
John D'Errico
el 7 de Feb. de 2019
To me the issue seems to me the definition of flatness.
For example, you might have a perfectly fitting line, with a slope of 10, but no deviation from that line. Is that "flat"?
Or, how about a parabolic shape, but one that will have a resulting slope of zero, when you fit the line to it. I the slope is zero, is that "flat"?
Or, what about a noisy set of points, but one that has again, a slope that is perfectly zero. Again, is that "flat"?
So what is needed is the definition of what "flat" means here.
Note that the final computation of a set of least squares fits can actually be achieved with merely a dot product, so a matrix*vector product, to then compute the slopes of every line at once.
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical 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!