title: matlab array subsetting by indices
body: <p>Let's say I have a 3x3x3 Matlab array with members 1 to 27  </p>
  
  <p><code>a=reshape(1:27, [3 3 3])</code></p>
  
  <p>I would like to create a subset of this with a syntax like </p>
  
  <p><code>b=a(range1,range2,range3)</code></p>
  
  <p>where for range1=range2=range3=1:2 I would get the members <code>b(1,1,1)</code> and <code>b(2,2,2)</code>. i.e</p>
  
  <p><code>b= [1 14]</code></p>
  
  <p>Is it possible to do this just with indexing and without any functions (e.g. diag)? Thanks...</p>