Find the position of equal elements in a matrix using Matlab
<p>Suppose I have:</p>

<pre><code>m = [1,2,3;1,4,5;6,4,7]
</code></pre>

<p>I want to get a list containing the positions of the elements in the matrix <code>m</code> so that the positions of equal elements are grouped together. The output for matrix <code>m</code> must be:</p>

<pre><code>{{1,1},{2,1}},{{2,2},{3,2}},{1,2},{1,3},{2,3},{3,1},{3,3}
%     1             2         3     4     5     6     7
</code></pre>

<p>We can see here that the positions for the elements that are all equal to each other are grouped together.</p>