I have a cell array C containing 380 matrices and want to put them in 3-dimensional matrix M such that the 1st 20 matrices of C will be in M(:,:,1), the 2nd 20 matrices (from 21 to 40) in M(:,:,2) and so on.
Edit: I want to concatenate them columnwise.
Can I do this in a one loop in Matlab.
for i = 1:20:380and use the indexed assignment operator as you showed in your question to organize the elements as you wish. If the dimensions are not so neat, you may have to nest a loop to deal with the 20 individual matricesfor j=1:20and slot them into the correct positions - im so confused