Find flattest line from matrix of vectors plotted against x values

조회 수: 1 (최근 30일)
BOB
BOB 2019년 2월 6일
댓글: John D'Errico 2019년 2월 7일
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!

채택된 답변

Jeff Miller
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
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 CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by