MATLAB: Combine the rows of an mxn cell array into a single mx1 cell array.

cellcell arraysconcatenationMATLAB

I have a cell array of a known number of columns but a variable number of rows.
For example, I might have a 2×3 cell: A = {'hi',1,2;'bye',3,'bob'}.
I'm trying to output a 2×1 cell: B = {{'hi',1 2};{'bye',3,'bob'}}.
I tried using cat(), to no avail. Any suggestions?

Best Answer

num2cell(A,2)