|
|
CELL2MAT Convert the contents of a cell array into a single matrix. y H- i% _) V/ k8 c( [0 m
M = CELL2MAT(C) converts a multidimensional cell array with contents of
5 k+ T1 o. D ]/ h0 Y* P* U9 W the same data type into a single matrix. The contents of C must be able
$ ~; e/ D) N L4 |5 l$ g8 y to concatenate into a hyperrectangle. Moreover, for each pair of) g3 v l- b: V/ W2 K
neighboring cells, the dimensions of the cell's contents must match,
6 g5 y* B$ F* C excluding the dimension in which the cells are neighbors. This constraint7 `$ P9 h( d& I. |9 r0 B9 |. b0 Q$ B9 i
must hold true for neighboring cells along all of the cell array's
- D: q$ L# Q$ i0 s; `7 v dimensions./ n/ N$ K7 o6 L6 N
9 X, {$ }! E) \* p1 z& z The dimensionality of M, i.e. the number of dimensions of M, will match7 t4 T1 y, W3 y- T
the highest dimensionality contained in the cell array.0 T; e, d0 x0 b- @ i- ?! G( _
8 A) O4 \% o6 S) J8 L0 l3 _: ^1 B& }
CELL2MAT is not supported for cell arrays containing cell arrays or
% S# A4 `6 I K# Y* [4 e9 R# L objects.
3 k; r4 z; I; ~/ C# s6 E
: X6 k4 S# K8 f* ^5 D6 l4 [" C J6 f) h Example:
7 T5 h. g: a( d1 L& ~+ V0 P. A C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};2 x% i, @! ?4 @, V I9 C3 J5 {, O3 H
M = cell2mat(C)
5 u& q8 u7 R/ X6 k- K
6 M7 a. K) W/ Q7 t$ { See also mat2cell, num2cell
6 g3 S: N3 z& K+ m$ y% z) l$ f3 k$ M! g/ h# W4 k
Overloaded methods:% K6 @0 M0 k& ^8 m9 O( A; R: e
distributed/cell2mat
& k/ g) d' ?3 i' x9 h) k. f5 G
Reference page in Help browser/ X: O+ L$ H6 L) j* l0 D
doc cell2mat
, A' c; o4 j0 R% a- k9 {8 s& N( M |
|