title: Matlab: selecting non-consecutive matrix columns
body: <p>I've got a 28 x 28 x 1 x 10000 matrix called <code>data</code> and a 1 x 10000 vector called <code>labels</code>, which consists of a bunch of integers from 0 - 9. What I'd really like to do is split the <code>data</code> matrix into 10 smaller matrices, corresponding to the <code>label</code> values.</p>
  
  <p>Is there any way to do this other than a for loop?</p>