title: How do I get the two last dimensions of an N-D array as a 2D array?
body: <p>I have a 3D array in MATLAB, with <code>size(myArray) = [100 100 50]</code>. Now, I'd like to get a specific layer, specified by an index in the <em>first</em> dimension, in the form of a 2D matrix. 
  I tried <code>myMatrix = myArray(myIndex,:,:);</code>, but that gives me a 3D array with <code>size(myMatrix) = [1 100 50]</code>.</p>
  
  <p>How do I tell MATLAB that I'm not interested in the first dimension (since there's only one layer), so it can simplify the matrix?</p>
  
  <p>Note: I will need to do this with the second index also, rendering <code>size(myMatrix) = [100 1 50]</code> instead of the desired <code>[100 50]</code>. A solution should be applicable to both cases, and preferably to the third dimension as well.</p>