Bulk concatenation of cell array contents (without looping)?
古いコメントを表示
Hi,
I have a 1x4 cell whose elements are all 1x40 cells. Each of the elements of the 1x40 cells is a 1000x128 array of doubles.
Is there a way to concatenate the contents of the elements in the 1x40 cells into a 40000x128 array of doubles without looping through the elements individually?
Thanks, Alex
採用された回答
その他の回答 (2 件)
Ramis Rafay
2017 年 7 月 23 日
0 投票
I think this will work for any given number of elements without looping
stackedarrays = vertcat(mycell{:,:})
1 件のコメント
theblueeyeswhitedragon
2018 年 6 月 27 日
編集済み: theblueeyeswhitedragon
2018 年 6 月 27 日
This gives you back a mxn matrix, which you could easily obtain by using cell2mat().
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!