title: MATLAB: How do you call a "cross-section" of an m-dimensional array?
body: <p>In MATLAB, I have a multidimensional array of floats, <code>A</code>, with <code>m</code> dimensions; that is, its entries can be referenced with <code>A(n_1, n_2, ..., n_m)</code>.</p>
  
  <p>I don't know if there is a good way to describe this using technical terms, so let me just use an example: if <code>A</code> is a 4-dimensional array, then </p>
  
  <p><code>A(:,:,1,:)</code> is a 1<sup>st</sup> cross section of <code>A</code> in the 3<sup>rd</sup> coordinate. Similarly,</p>
  
  <p><code>A(:,2,1,:)</code> would be the (2,1)<sup>th</sup> cross section of <code>A</code> in the 2<sup>nd</sup> and 3<sup>rd</sup> coordinates.</p>
  
  <p>So my general question is, given an <code>A</code> whose dimensions are only determined at runtime, how do I reference the <code>(k_1,...,k_j)</code><sup>th</sup> cross section of <code>A</code> in the <code>(c_1,...,c_j)</code> coordinates, where the <code>k</code>'s and <code>c</code>'s are also variables?</p>