title: Grouping elements of a matrix in groups, given that they satisfy certain conditions
body: <p>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). </p>
  
  <p>I now want to write a program in Matlab that does the following from me:</p>
  
  <p>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 &lt; d &lt; 400. I also want Matlab to tell me how many elements satisfy this condition.</p>
  
  <p>I was thinking of using the command 'discretize', but I'm not sure how to use it. </p>
  
  <p>Any help on how to do this is appreciated.</p>