Extract an array of doubles from a nested cell array

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:
{{1x421};[1x421]}
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

 採用された回答

Andrei Bobrov
Andrei Bobrov 2012 年 3 月 27 日

2 投票

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

1 件のコメント

Struan
Struan 2012 年 3 月 27 日
Works Perfectly!
Thanks
Struan

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Matrices and Arrays についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by