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!