Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
How to draw linear lines on a set of data and find which line has the most points on it?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a set of error-data and this error increases per inch (distance). But this data is not perfectly linear. I want to draw a number of linear lines on the plotted graph and then check which line has the most data points on it or near to it. How should i do it? The data for this is
inch (distance)=[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14--------25 26 27]; error=[-5.5494 -6.7142 -4.2772 -4.4059 -3.7628 -4.2873 -3.2144 -2.058 -2.1906 -2.3534 -1.5007 -1.9778 -1.4085 0 0.6107 1.2219 2.0251 0.9636 1.98 2.1989 3.052 4.5974 3.4878 4.3893 4.8776 3.4843 2.5935];
The plotted graph is attached herewith.
Thanks in advance
댓글 수: 1
Guillaume
2016년 6월 23일
Why don't you want to do a least square fit rather than come up with your own fitting algorithm?
답변 (1개)
KSSV
2016년 6월 23일
1. You can use knnsearch to find how many points are closer to a given points. 2. You can use find(x<xmin & x>xmax) to know points lying between [xmin, xmax].
Hope you got the gist.
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!