How to combine cell arrays into a uniform one
14 次查看(过去 30 天)
显示 更早的评论
Hello!
Can anybody please help me with this problem:
I have a cell array 8×1. 1 column of 8 this {100×1 double} cells. And also I have another cell array 4×1. 1 column of 4 this {100×1 double} cells. I need to join them in one clumn of 12 cells. I would think the syntax it is similar to normal arrays like joint_array=[A;B].
I was trying different ways but the best result is 2×1 cell array
{8×1 cell}
{4×1 cell}
I need to smoosh it all into one box, to become 12×1 cell array. the data in cells is same type {100×1 double}
thank you.
采纳的回答
madhan ravi
2019-1-4
编辑:madhan ravi
2019-1-4
C = {{1:3},{3:5}} % an example data
C = vertcat(C{:}) % combined cell array as one
vertcat(C{:}) % concatenated again to convert as a double array
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!