Convert cell array to an array, when the size of the cells is different
3 次查看(过去 30 天)
显示 更早的评论
Hi all,
I have a cell array like this A={ [0 0 0 0] ; [1 1] ;[2] }
Is it possible to convert it in an array? I tried with cell2mat but I get an error because the sizes are different
thanks
Nikolas
0 个评论
采纳的回答
更多回答(1 个)
madhan ravi
2018-12-4
[A{:}] % which is eqivalent to horzcat(A{:})
3 个评论
madhan ravi
2018-12-4
编辑:madhan ravi
2018-12-4
just give an example of your desired output in the example you gave! plus how can you put them in an array when the number of columns are different??
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!