|
|
CELL2MAT Convert the contents of a cell array into a single matrix.8 N) f, p6 T' F6 j! u+ Q
M = CELL2MAT(C) converts a multidimensional cell array with contents of
: H7 N3 H/ ~, {2 t3 G( i; A the same data type into a single matrix. The contents of C must be able
$ l" Q* q+ k: j5 T o& _ to concatenate into a hyperrectangle. Moreover, for each pair of& {- @( w3 r% u- ?' n& Y
neighboring cells, the dimensions of the cell's contents must match,9 l" n2 @( B. V: X7 g# u9 N- R W3 M
excluding the dimension in which the cells are neighbors. This constraint9 o; n: O, m# F7 [( R# R
must hold true for neighboring cells along all of the cell array's
8 K2 h7 q, `9 D$ P- k7 I dimensions.
, k+ ?* Q' p7 N+ ^2 h- j4 g/ W' o! K+ s% z( |0 k
The dimensionality of M, i.e. the number of dimensions of M, will match' E# T6 d$ N4 R' F$ R' [
the highest dimensionality contained in the cell array.9 D! {7 N2 W6 r- ~3 k/ S
( w' O2 m5 A# e l# p0 z CELL2MAT is not supported for cell arrays containing cell arrays or
# Z9 {; J$ H4 q' C% L% L6 _ objects.
% O; `. ?/ X |4 L9 C7 j2 A8 Q, T8 \) F) n
Example:
6 U% z5 Z) n% L& W& o8 H C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
; G8 {3 r' A# w. [& Q M = cell2mat(C)
& V0 H1 I6 `$ u) x. k6 i3 V* o
" B/ U9 ]: t+ K See also mat2cell, num2cell( J! W+ {# W; p& A" E
- {/ w q6 d+ h3 c Overloaded methods:3 U, z2 A( k, M5 P! K( Z
distributed/cell2mat
; M% h4 i/ ?2 i8 ?
& |! b% h. P! O% M2 d) w Reference page in Help browser
: z2 b+ q/ q$ N( q) d! W doc cell2mat |
|