title: MATLAB: index a cell array with cell array of arrays and return a cell array
body: <p>Say I have a cell array of (n X 1) vectors, <code>A</code>, and a cell array of vectors containing indices into <code>A</code>, called <code>B</code>.  I wish to extract a cell array, <code>C</code>, such that <code>C{i} = [A{B{i}}]</code>.<br>
  In other words, I have a cell array of arrays of indices, and I want to pull out the matrices corresponding to the concatenations of the vectors in <code>A</code> indexed by each of those arrays of indices.  </p>
  
  <pre><code>for i = 1:length(B)
      %# B{i} is an array of indices, C{i} is a matrix
      C{i} = [ A{ B{i} } ];
  end
  </code></pre>
  
  <p>The loop is equivalent to:  </p>
  
  <pre><code>C = cellfun(@(x)[A{x}],B,'UniformOutput',false); %# implicit for loop w/ closure
  </code></pre>
  
  <p>Can I do that using an indexing expression alone?  Or at least without the loop?<br>
  I think <code>deal()</code> might have to be involved but can't figure it out.  </p>