title: How to find the max of each "slice" in a multidimensional matrix in matlab?
body: <p>I have an n-dimensional matrix Q. I can find the max values through
  the last dimension by:</p>
  
  <pre><code>m = max(Q,[],n).
  </code></pre>
  
  <p>However, I do not know how to find the max values through the last
  "slice". I need something "like"</p>
  
  <pre><code>m = max(Q,[],n-1,n).
  </code></pre>
  
  <p>For example, if I have</p>
  
  <pre><code>A(:,:,1) = [1 2 3 ; 4 50 6]
  A(:,:,2) = [9 8 7 ; 10 12 1]
  </code></pre>
  
  <p>I would like to have <code>m = [9 50]</code>.</p>
  
  <p>Can you help me with this?</p>