找回密码
 注册
关于网站域名变更的通知
查看: 1010|回复: 3
打印 上一主题 下一主题

Matlab怎么把元胞数组转化成矩阵?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2021-6-30 09:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
3 H$ p1 t; O! b! l( }- X5 L0 ]

: x$ e& A& ]4 Z4 I& u! g/ ZMatlab里怎么把元胞数组的内容转化为矩阵?(元胞数组的每个元胞都是double型的数)。
+ p9 a5 `) ?! m: g( K5 ?) ^

该用户从未签到

2#
发表于 2021-6-30 11:11 | 只看该作者
定义一个矩阵,然后把数组放进去啊

该用户从未签到

3#
发表于 2021-6-30 11:11 | 只看该作者
help cell2mat

该用户从未签到

4#
发表于 2021-6-30 11:31 | 只看该作者
CELL2MAT Convert the contents of a cell array into a single matrix.
" d1 a. Y& l6 a" V    M = CELL2MAT(C) converts a multidimensional cell array with contents of
, q' l  A# B9 P    the same data type into a single matrix. The contents of C must be able
. A0 |2 |- o, N8 f    to concatenate into a hyperrectangle. Moreover, for each pair of
. w9 M! a" Z9 w) v' L  `    neighboring cells, the dimensions of the cell's contents must match,
. u" ?9 k( Z4 \    excluding the dimension in which the cells are neighbors. This constraint( T# p+ ~/ W9 D; f. P2 i0 o$ h
    must hold true for neighboring cells along all of the cell array's
7 z) H( G+ p. Q) ~$ _, p/ l& ~4 `    dimensions.
: I+ r2 q  ^; J4 z& U2 H
1 z* l0 [6 N5 _( N    The dimensionality of M, i.e. the number of dimensions of M, will match
8 X9 j) R9 F. }' {0 j    the highest dimensionality contained in the cell array.
5 I  M0 h( x- @$ r4 ]% ^' E
6 r5 k9 Q4 w6 k$ P/ O$ W    CELL2MAT is not supported for cell arrays containing cell arrays or
# t! J( `% B# o) a- W1 z. b    objects.
7 v! I7 P* D% l! }
  e! j0 w. ]0 x# ]        Example:
+ ?; c5 g4 _, ?           C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
! F5 Z6 O" p* A: c' m! Z* g           M = cell2mat(C); r) q+ ~2 h: n+ Y

3 c. p8 `1 Q/ }9 w/ M" Z/ \/ ?        See also mat2cell, num2cell
" ^' I! E) \& k1 g. k. [1 T- ?* s
    Overloaded methods:
9 t+ g* A4 x, g4 y% O5 @6 a       distributed/cell2mat
3 ^: Y, r7 g0 I0 O6 E
- r4 g- s/ y( s1 ]9 s; a    Reference page in Help browser$ y+ ]( i6 P, n' ]) F; V2 \
       doc cell2mat; ^3 s1 m; ^8 I$ B1 O8 D& ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-8-11 12:52 , Processed in 0.109375 second(s), 23 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

快速回复 返回顶部 返回列表