MATLAB: How to find the distances between two points in X-Y plane

2deuclidean distanceshortest distancex-y plane

I have two matrices with x values in column 1 and y values in column 2.
I have to find the distances between the values in matrix 1 and matrix 2.
Is there a function to directly find the euclidean distance between the points in both the matrices?

Best Answer

Use euclidean distance
1111Untitled.png
d = sqrt( (x2-x1).^2 + (y2-y1).^2 );