MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   如何将64 x 64单元合并为1 x 1单元 (https://www.labfans.com/bbs/showthread.php?t=23297)

poster 2019-12-10 20:30

如何将64 x 64单元合并为1 x 1单元
 
我有一个64 x 64单元,如何将其合并回1 x 1单元?每个单元格是8 x 8的两倍。



[B]回答:[/B]

使用[URL="http://www.mathworks.com/access/helpdesk/help/techdoc/ref/cell2mat.html"]cell2mat[/URL] 。

%# 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); [B]编辑[/B]

如果您希望结果再次成为单元格,请运行

m = {cell2mat(c)};

[url=https://stackoverflow.com/questions/2612870]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 02:58

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.