MATLAB: Divide a cellarray in n parts

cellarray divide

I've {A} that is linear cell array 1xN. I would like divide this vector in M parts. {B} is MxL matrix of cell. (MxL=N). Thanks.

Best Answer

A=num2cell(1:20);
out=reshape(A,4,5)