title: How to get the bounding box of non-zero elements in MATLAB?
body: <p>Let's say, I have a matrix (by <a href="http://www.mathworks.se/help/techdoc/ref/imread.html" rel="nofollow">imread</a>) as following:</p>
  
  <pre><code>A = [0 0 1 0 0; 
       0 0 1 0 0; 
       0 1 1 1 0; 
       0 0 1 0 0; 
       0 0 0 0 0];
  </code></pre>
  
  <p>I would like to get the bounding box of non-zero elements as</p>
  
  <pre><code>BB = show_me_the_bounding_box(A);
  BB = [1, 2, 4, 4]; % y0, x0, y1, x0
  </code></pre>
  
  <p>What function I should use to do that?</p>