title: Find the minimum non zero value in a matrix
body: <p>I'm trying to find a 2d array that represents the minimum values of the 3rd dimension in a 3d array., e.g.</p>
  
  <pre><code>a = floor(rand(10,10,3).*100); % representative structure
  b = min(a,[],3); % this finds the minimum but also includes 0 
  </code></pre>
  
  <p>I tried using:</p>
  
  <pre><code>min(a(a&gt;0),3) 
  </code></pre>
  
  <p>but that isn't correct? I guess I could sort the third dimension of a and then find the minimum within 1:depth-1 - but that doesn't seem the most efficient way?</p>
  
  <p>Any thoughts?  </p>