MATLAB: Extract an array of doubles from a nested cell array

cell arraysindexing

Hello,
I have a cell array X which is {n x 9}. All the cells in column 9 contain a cell array and an array of doubles in this form:
{{1×421};[1×421]}
I would like to extract all the doubles to a new matrix(n x 421). Is there a way to do this with out using for loops?
Many thanks
Struan

Best Answer

out = cell2mat(cellfun(@(x)x{2},X(:,9),'un',0))