# g! \$ C8 S, r9 T) h $ K1 H, N t& I5 N& T; }Matlab里怎么把元胞数组的内容转化为矩阵?(元胞数组的每个元胞都是double型的数)。0 B: F- C- y @ 作者: NNNei256 时间: 2021-6-30 11:11
定义一个矩阵,然后把数组放进去啊作者: CCxiaom 时间: 2021-6-30 11:11
help cell2mat作者: ulppknot 时间: 2021-6-30 11:31
CELL2MAT Convert the contents of a cell array into a single matrix. I- p: c" w! v& i9 K. [
M = CELL2MAT(C) converts a multidimensional cell array with contents of+ ^1 v0 l6 p8 A7 h7 T
the same data type into a single matrix. The contents of C must be able 7 Q: k; B" a$ s& ~9 F to concatenate into a hyperrectangle. Moreover, for each pair of7 G* I( L5 w1 f& j& t/ W
neighboring cells, the dimensions of the cell's contents must match,( z. f+ q+ }' w' d& C! q: m
excluding the dimension in which the cells are neighbors. This constraint7 Y$ h4 ?; C( a8 C5 t* [
must hold true for neighboring cells along all of the cell array's . {; {$ J8 U8 }" B; L dimensions.& k" O' [2 W% t: @: e8 @
. q" W1 ?) a, i9 }. _" A
The dimensionality of M, i.e. the number of dimensions of M, will match9 a7 O8 w" ?2 S
the highest dimensionality contained in the cell array.* ?) f% s* j* r; d( \9 L4 i) `
7 G* \$ H0 g5 u+ y6 F2 @
CELL2MAT is not supported for cell arrays containing cell arrays or3 x" ?& i: L6 H- J+ j; G: m& n
objects. ! L1 h8 ?# Q4 A+ q& Z9 _ ]+ ?* V! I4 ]. V& O: f K4 G5 V$ R; f
Example: , R, s) p! A4 G& `9 Y! U4 h; q+ ?& ` C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};7 P. \2 L8 x5 f( D
M = cell2mat(C) " Y$ k. a1 Z+ Z$ l2 G' J9 i/ Z' x* {/ ?4 a4 j
See also mat2cell, num2cell 0 B* @: a6 A1 D- h4 k* m . |9 d2 H7 q* z2 I Overloaded methods:$ j! Y3 }" c9 C7 I3 n' X4 ?
distributed/cell2mat$ Y) r! j3 w+ \
1 K; D) v, k$ U, y; \ Reference page in Help browser 0 |& w' K% w9 a, X) S( w doc cell2mat) V0 Q$ U+ C9 n6 n$ b. J