I’ve got a 28 x 28 x 1 x 10000 matrix called data and a 1 x 10000 vector called labels, which consists of a bunch of integers from 0 – 9. What I’d really like to do is split the data matrix into 10 smaller matrices, corresponding to the label values.
Is there any way to do this other than a for loop?
Matlab allows slice indexing. For example:
I can’t see how you’re getting “non-consecutive”. There’s a hint there of selecting on the label, but the dimensions don’t match. If they did:
or