How can i measure the distance between points in a scatter graph
6 次查看(过去 30 天)
显示 更早的评论
Looking to measure the Manhattan distance between the points on my scatter graph
0 个评论
回答(1 个)
José-Luis
2017-2-10
2 个评论
José-Luis
2017-2-10
You are trying to get the distance of a graphic object handle (in your case a line).
Perhaps this is what you meant:
x = [0, 6, 6, 6, 7, 7, 8, 8];
y = [0, 0, 2, -2, 2, -2, 2, -2];
D = pdist([x',y'],'cityblock')
Please read the documentation. Also, please accept the answer that best solves your problem.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!