How to find the linear distance between two points say (x,y) and (m,n) on an image?
138 次查看(过去 30 天)
显示 更早的评论
Hi..How can we find the linear distance between any two points on an image?Can we do this using any inbuilt function??or can this be done in any other way??plz help..
2 个评论
Fernanda Rivera
2017-6-28
You can use the function pdist2 such as:
value=pdist2([x m],[y n],'euclidean'); %obtaining euclidean distance
Also if it works better for you, you can develop the formula:
value=sqrt((x-m)^2 + (y-n)^2); %euclidean distance.
回答(1 个)
另请参阅
类别
在 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!