MATLAB: How to split one big matrix in several matrices

mat2cellsplit matrices

I'm trying to split a 72×10 matrix in 10 24×3 matrices. The new matrices need to have in each line, 3 elements (which make 3 columns) of each column of the original 72×10 matrix. I tried to use mat2cell but always get the error "Input arguments, D1 through D2, must sum to each dimension of the input matrix size, [72 10]". I'm clearly not understanding something here.

Best Answer

cellfun(@(V) reshape(V, 24, 3), num2cell(a,1), 'uniform', 0)