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 mat2celleg:out = num2cell(yourmatrix,1)orout = mat2cell(yourmatrix,2,ones(1,size(yourmatrix,2))) Related SolutionsMATLAB: Separating matrix into column vectors mat2cell(YourMatrix, size(YourMatrix, 1), ones(1,3))To get it as a cell array. MATLAB: How to concatenate 2 cell arrays FirstCell = num2cell(randi(9, 15, 9), 2);SecondCell = num2cell(randi(9, 15, 9), 2);size(FirstCell)ans = 1×2 15 1 size(FirstCell{1})ans = 1×2 1 9 output = cellfun(@(a,b) [a;b], FirstCell, SecondCell, 'uniform', 0);size(output)ans = 1×2 15 1 ●size(output{1})ans = 1×2 2 9 ● Related QuestionWhat is the fastest way to convert mat to cell for the following algorithmConvert an 18×1 cell array in a 3×6 cell arrayAdding a frame of zeros to a matrixDelete empty [] {1×7 cell} {1×2 cell}How to count the 1X1 cells in a cell arrayHow can i merge multi columns of a matrix in another matrix with single column
Best Answer