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

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

[复制链接]

该用户从未签到

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

EDA365欢迎您登录!

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

x
( C; I/ h2 q* n* N

$ b9 D0 B6 Q. E/ W  @5 |Matlab里怎么把元胞数组的内容转化为矩阵?(元胞数组的每个元胞都是double型的数)。6 |$ z9 J9 d: B! [, ^$ o

该用户从未签到

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.
0 R. O% k6 N' E9 d+ K" a    M = CELL2MAT(C) converts a multidimensional cell array with contents of
9 f, F/ `+ s5 c  e1 l2 L    the same data type into a single matrix. The contents of C must be able
7 d1 K% Q; X$ y. s    to concatenate into a hyperrectangle. Moreover, for each pair of
% x! U; Q% s/ C% F% k5 B    neighboring cells, the dimensions of the cell's contents must match,: _) V" }" {+ N: d) j0 e, r+ X
    excluding the dimension in which the cells are neighbors. This constraint& n# n$ O% i( T% i0 s- W* m
    must hold true for neighboring cells along all of the cell array's
0 F+ u) k! |, h/ _/ r( P    dimensions.- \$ U/ {- n* t# `# h) o  r  J
* Z4 ]1 y& _, ~
    The dimensionality of M, i.e. the number of dimensions of M, will match
1 _2 E' v# G- p: i3 }" |    the highest dimensionality contained in the cell array.
. L" F( R' W1 ?6 g! W; `# G( x6 {0 Z# B( l5 x6 m6 C' p6 ?
    CELL2MAT is not supported for cell arrays containing cell arrays or
' Q8 w; B- E& n- C    objects.
( M. H! j8 T' `% Q) Y% g! c, ?$ n2 ^( |& O- ^4 A% W0 w2 e& X& Z
        Example:
  {& I( z8 l, y. i; c           C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};& P/ R0 l! a: L$ L8 l
           M = cell2mat(C)
9 ^# l! m/ G  g  n' n0 u* g8 Y! I. p( l) F
        See also mat2cell, num2cell1 K: `+ i) Z+ P4 O  C& [9 x

6 D4 o; \, r8 _    Overloaded methods:
) L" _# ^6 s: d9 X: F/ I) q       distributed/cell2mat# S9 B; u1 d1 [7 I5 E0 h' @

$ Y4 I: w  ~7 _' k. f9 P" o, m    Reference page in Help browser; J" Y% Q; \  ]6 W: Q; d/ k
       doc cell2mat7 T" r% K& h2 G2 u3 Q
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

EDA365公众号

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

GMT+8, 2025-7-19 03:52 , Processed in 0.109375 second(s), 24 queries , Gzip On.

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

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

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