I am working with pretty big arrays of data, but here I'll consider a toy example.
a is 6x3 array:
I want to reshape it to the array of size
(3,3,2) by horizontal slices, so that the resulting array
b would be:
I was trying to do it with the reshape function:
b=reshape(a,[3,3,2]), however, the resulting array is different (in goes though columns first).
I didn't really find the appropriate options for the reshape function.
Is there a nice solution to this issue? I know how to do it with a single for loop.