I have a matrix with entries as "1" at random places and i need to find (a) find its non-zero neighbours (b) find the euclidean distance between its non-zero neighbours and the pixel itself
MATLAB: How to find the distance between two non-zero (the element is a one) elements in a matrix
euclidean distanceneighbours
Best Answer