title: Finding a pixel position in matlab
body: <p>I need to scan a (half of) binary image and store (or mark) only the position of first black pixel. I tried this out in matlab. But the code is displaying the positions of all the black pixels. My code is something like this.</p>
  
  <pre><code>I= imread('binary image');
  
  imshow(I);
  
  [r c] =size(I);
  
  for j=1:c/2
  
      for i=1:r
  
          if(I(i,j)==1)
          [i j]    
          end
      end
  end
  </code></pre>
  
  <p>Any suggestions to improve this...</p>