Algorithm to draw a straight line through given points?
1 次查看(过去 30 天)
显示 更早的评论
Let's suppose I have bunch of random points as shown in the figure below. Now, is there any algorithm in matlab that would draw a straight line through these points as long as the distance from this line to all points along the line is less than a threshold value (d<threshold)
0 个评论
采纳的回答
Image Analyst
2015-4-6
编辑:Image Analyst
2018-8-28
See my polyfit() demo, attached below the image.
You will have to do two passes. One to get the line, then get the distances, then delete the data points that are too far, then run it again on the remaining points.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!