title: Converting a m x n matrix to a n*m x 3 matrix
body: <p>I currently have a matrix that is 479 x 729, and I would like to convert this matrix into a three column matrix such that the first column is the row entry of the original matrix, the second column is the column entry of the original matrix, and the third column is the value at that column and row entry.</p>
  
  <p>Is there an easy way to do this? I have looked at the <code>reShape</code> function but have not figured out how to apply this here. The motivation for this is to be able to create a distance table for elements within the matrix that includes their location. </p>