Cell 2 3d matrix
8 次查看(过去 30 天)
显示 更早的评论
Hej, I have a cell [1x25] of [256x256 int16] I would like to convert cell into a 3d matrix [256x256x25] (create a stack) but if i using cell2mat I obtain a [256x6400] matrix. Could anyone halp me?
0 个评论
采纳的回答
Jos (10584)
2013-12-13
Use CAT and comma-separated list expansion:
sz = [2 3] ; % arbitray size
C = {rand(sz), ones(sz), zeros(sz)} % example of your cell data (all elements the same size!)
M = cat(3,C{:}) % concatenate in the 3rd dimension
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!