MATLAB: How to convert a matrix to a cell array

arraycell arraysmatrix

Hi there,
I have a 2×10 matrix. Would anybody know how I could convert it into a 1×10 cell array – so that each cell contains a 2×1 matrix?
I'm new to matlab and would appreciate any help.
Kind Regards
John

Best Answer

please read about functions num2cell and mat2cell
eg:
out = num2cell(yourmatrix,1)
or
out = mat2cell(yourmatrix,2,ones(1,size(yourmatrix,2)))