MATLAB: Unnest cell array with nested cells to a cell array

expand outunnest

How do I expand out an array with dimension '<100×1 cell>' in which each cell has a dimension '<1×11 cell>' into an array with dimension '<100×11 cell>'. Surely this must be straightforward? Thx

Best Answer

% Sample Data
C = repmat({num2cell(1:11,1)},100,1);
% Unpacked
C2 = vertcat(C{:})
Unpack ( {:} ) it and use comma-separated list expansion in vertcat.
Related Question