Concatenating double arrays from same cell array
1 次查看(过去 30 天)
显示 更早的评论
Hi
I know how to concatenate elements of two cells with cellfun, however I want to concatenate double arrays of the same cell to each other, and save this concatenation as the only remaining element of the cell. So, if my cell has 3 elements, the first is a 5x1 double array, the second element is an empty array, the third is a 3x1 double array, I would like to have at the end a 5x1 array in mycell{1}. How would I do that? Many thanks
2 个评论
回答(1 个)
Jan
2017-1-29
Perhaps you do not want a {[5x1]} but {[8x1]} result?
C = {(1:5).', [], (6:8).'};
D = {cat(1, C{:})};
0 个评论
另请参阅
类别
在 Help Center 和 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!