开发者

How to merge a 64 by 64 cell into a 1 by 1 cell

I have a 64 by 64 cell and how do I merge it back into a 1 by 1 cell? Each cell is a 8开发者_运维问答 by 8 double.


Use cell2mat.

%# create a sample 2-by-2 cell array
c = cell(2);

%# put a 3-by-3 double into each cell
[c{:}] = deal(magic(3));

%# convert to one big 6-by-6 array
m = cell2mat(c);

EDIT

If you want the result to be a cell again, run

m = {cell2mat(c)};
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜