Find flattest line from matrix of vectors plotted against x values
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Jeff Miller
2019-2-6
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 个评论
John D'Errico
2019-2-7
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.
更多回答(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!