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 中查找有关 Creating and Concatenating Matrices 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!