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!