|
|
CELL2MAT Convert the contents of a cell array into a single matrix.& m' ]& S7 z* e6 H* I
M = CELL2MAT(C) converts a multidimensional cell array with contents of
& s! f# u8 o; b r$ u" m4 i/ V the same data type into a single matrix. The contents of C must be able& H3 w- o* Y5 ]/ \8 p2 E' }6 N, z
to concatenate into a hyperrectangle. Moreover, for each pair of
: _. K, J* c \" F2 V7 L# v neighboring cells, the dimensions of the cell's contents must match,
( ^# P% e, m; |9 o' l/ x/ s excluding the dimension in which the cells are neighbors. This constraint5 A* |" g3 c; T
must hold true for neighboring cells along all of the cell array's
! }* }1 C$ M5 k6 k- ?2 J( o3 ~ dimensions.9 C( X3 O9 M+ C5 b" m( I- B0 Y( `$ R
0 [/ ^; W4 S/ J1 c The dimensionality of M, i.e. the number of dimensions of M, will match, Z, G7 [& K; V) F- Y8 L
the highest dimensionality contained in the cell array." p" a8 d7 V' Q- Q+ U
~& ` W! r& |2 ?* ?. P5 N CELL2MAT is not supported for cell arrays containing cell arrays or7 w! |; L& t& {% E3 }0 t( T
objects.
. C3 w% d1 t3 Y$ q/ P& f6 z7 k! L# M# z5 i* j0 ~& O6 a+ W
Example:$ d$ t3 _" i v' e7 e! f
C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
0 ` p4 x ^9 o" ^6 U M = cell2mat(C)) F& N, @0 G% B, `9 P$ D
! \1 v, K) v: f L7 e- o1 D% W See also mat2cell, num2cell7 n: U( j/ [* l- Q& L
$ S2 n. H1 b1 P9 h- M4 \1 ^! Q" Y
Overloaded methods:8 u; D- N' c$ ~/ E8 \
distributed/cell2mat) Y1 R( p! i" _ F5 p" E4 T6 x
2 a. g' ^# _2 ~' @1 o Reference page in Help browser6 B5 [4 p3 h/ ?5 q0 m
doc cell2mat |
|