title: matlab multiple dimensional indexing
body: <p>Consider the array </p>
  
  <pre><code> Arr = [a; b; c; d],
  </code></pre>
  
  <p>where a/b/c/d are all arrays of size n.</p>
  
  <p>And I have either an array like</p>
  
  <pre><code>index = [1 3 4 2 3 1...]
  </code></pre>
  
  <p>or</p>
  
  <pre><code>[
  [1 0 0 0 0 1 ....]
  [0 0 0 1 0 0 ....]
  [0 1 0 0 1 0 ....]
  [0 0 1 0 0 0 ....]
  ]
  </code></pre>
  
  <p>And I want to get out of this </p>
  
  <pre><code>[a; c; d; b; c; a ...]
  </code></pre>
  
  <p>How would I use indexing (either logical or otherwise) to do this. </p>
  
  <p>I would like something like
      Arr(index)</p>
  
  <p>but that obviously doesn't do what I want it to.</p>