开发者

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

开发者 https://www.devze.com 2022-12-26 02:30 出处:网络
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.

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

精彩评论

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