MATLAB: Arrange and merge cell data

cell arraysmerge

Hi,
I have a 3×3 cell as follows: [[1×40], [1×40], [1×40] ; [1×30], [1×30] ,[1×30] ; [1×50], [1×50] ,[1×50] ]
I would like to arrange the data, so that the final result is a 1×3 cell: [[3×40];[3×30];[3×50]]
I would like to do this without calling each cell specifically (in reality this is for a 20×20 cell)
Thanks

Best Answer

arrayfun(@(col) vertcat(YourCell{:,col}), 1:size(YourCell,2), 'Uniform', 0)