|
|
CELL2MAT Convert the contents of a cell array into a single matrix.* p0 L4 m5 ]. e
M = CELL2MAT(C) converts a multidimensional cell array with contents of X- f% N S4 e8 F* j
the same data type into a single matrix. The contents of C must be able1 q$ ?9 `$ [* |7 L. l
to concatenate into a hyperrectangle. Moreover, for each pair of
! f' q$ { D8 v+ b, j; z# u neighboring cells, the dimensions of the cell's contents must match,
+ m" I2 s3 s! m8 p1 G; D+ k4 ^: J& l excluding the dimension in which the cells are neighbors. This constraint8 G; s5 t8 R& }4 B
must hold true for neighboring cells along all of the cell array's
2 P) f* |) p' l; h4 r& L dimensions.- L( z2 v/ j: a6 |, \ j9 j
0 }- }8 ]1 I2 o The dimensionality of M, i.e. the number of dimensions of M, will match. `4 [0 U" `& R1 d
the highest dimensionality contained in the cell array.: r B+ _* `1 |7 ?4 ]
& D7 T8 T8 w3 V9 q8 l5 f6 T9 K
CELL2MAT is not supported for cell arrays containing cell arrays or
" s2 Y- ?% _- m, J0 u+ x objects.
# Y; q4 [# F y, |) \0 H2 ?2 g% w: l+ i9 o5 d$ k
Example:
1 \! k0 l) [, Q: T. { C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
9 Z% \% q4 o$ [7 ` M = cell2mat(C)
2 t# H! i1 `% _- X6 b( A! q/ D1 H) |+ y
See also mat2cell, num2cell9 X$ V3 `6 [3 G" z1 C
; t, w( s ^3 i, s& ~2 w7 O4 @
Overloaded methods:* F, \' A% z0 u
distributed/cell2mat
/ H5 n% @9 h8 h' [, y0 c: [) H/ Y7 H
Reference page in Help browser4 R8 O$ `2 ^5 y
doc cell2mat! C) f5 c* z& j
|
|