title: Translation of python/numpy "A.argmin(axis=-1)" into an equivalent matlab-expression
body: <p>I am a newbie in python and got python-code to translate into Matlab for my work. 
  I have a specific problem:</p>
  
  <p>I've got a matrix with size for example (rows/columns/3rd dim)  = (3/4/2). </p>
  
  <pre><code>A = array([[[1, 56, 0, 6],[5, 9, 10, 3],[50, 51, 59, 64]],[[2, 6, 4, 3],[10, 80, 53, 6],[12, 5, 36, 15]]])
  </code></pre>
  
  <p>For this matrix (and others) I have given the function</p>
  
  <pre><code>B = A.argmin(axis=-1)
  </code></pre>
  
  <p>which searches for the index of the minimum in every row. (<a href="http://docs.scipy.org/doc/numpy-1.10.1/reference/generated/numpy.argmin.html" rel="nofollow">numpy.argmin Manual</a>) </p>
  
  <p>B is in this case:</p>
  
  <pre><code>B = array([[2, 3, 0],[0, 3, 1]])
  </code></pre>
  
  <p>and of size (rows/columns) = (2/3).</p>
  
  <p>My ame is to convert exactly this into a Matlab-version, so that I get exactly this matrix, but in Matlab ([Min Matlab Manual][2])</p>
  
  <pre><code>[~,B] = min(A,[],2)
  </code></pre>
  
  <p>gives me a matrix of size (row/colums/3rd dim) = (3/1/2).
  <a href="http://i.stack.imgur.com/AsExu.png" rel="nofollow">Matlab Output</a></p>
  
  <p>The indices of the minimum in each row are the same, if one regard that python starts indexing at 0 and matlab at 1. The problem is the order of the matrix. </p>
  
  <p>How do I get the indeces of the minimum of each row in exact the order as python does it in matlab? </p>
  
  <p>I tried a lot with permute and vertcat, but this didn't work out and in the end it has to work for really big matrices.</p>
  
  <p>I would be pleased, if someone could help me.
  Thanks in advance!</p>