title: Convert non-zero image pixels to row-column coordinates and save the output to workspace
body: <p>I'm having difficulties converting image pixels to coordinates and making them appear in my MATLAB workspace. For example, I have the image with pixel values as below (it's a binary image of size 4x4):</p>
  
  <pre><code>0 0 0 0
  
  0 1 1 0
  
  0 1 1 0 
  
  0 0 0 0
  </code></pre>
  
  <p>After getting the pixels, I want to read each value and if they're not equal to zero (which means 1), I want to read the coordinates of that value and save them in to my MATLAB workspace.  For example, this is the idea that I thought of:</p>
  
  <pre><code>[x,y] = size(image)
  for i=1:x
     for j=1:y
         if (image(i,j)~=0)
         ....
  </code></pre>
  
  <p>However, I am stuck. Can anyone give any suggestion on how to read the coordinates of the non-zero values and save them to my workspace?</p>
  
  <p>Specifically, my expected result in the workspace:</p>
  
  <pre><code>2 2
  
  2 3
  
  3 2
  
  3 3
  </code></pre>