MATLAB: Efficient slicing of cell array

cell arraycell arraysMATLAB

I have a cell array of the form:
c =
[1x100 double]
[2x150 double]
[3x200 double]
And I would like to create a 6×50 matrix consisting of all rows and the first 50 columns of each constituent matrix. Is there an efficient way to do this?

Best Answer

variant
cell2mat(cellfun(@(x)x(:,1:50),C,'un',0));