in Matlab I have a (436 x 377) matrix, called 'distance_center', which contains (Euclidean) distances with respect to the center. The center is in the position (243,57) = (i,j), which I have chosen as the origin. So on position (243,57) of the matrix 'distance center' I have the value 0. For all the other elements in the matrix I have calculated the distance from the center with sqrt((x_i - x_j)^2 + (y_i - y_j)^2).
I now want to write a program in Matlab that does the following from me:
I want to know the positions (indices (i,j)) of all the elements that satisfy a certain condition. For example: I want to know the positions of the points whose Euclidean distance d from the center satisfy 390 < d < 400. I also want Matlab to tell me how many elements satisfy this condition.
I was thinking of using the command 'discretize', but I'm not sure how to use it.
Any help on how to do this is appreciated.