|
CELL2MAT Convert the contents of a cell array into a single matrix.% D: I. B$ S% ?$ ~, u
M = CELL2MAT(C) converts a multidimensional cell array with contents of
0 c& w) Q! @6 X the same data type into a single matrix. The contents of C must be able
% q r! A8 \( { to concatenate into a hyperrectangle. Moreover, for each pair of. n1 D7 V6 q) T
neighboring cells, the dimensions of the cell's contents must match,
) g7 c7 c9 K. Y u0 h0 M/ A excluding the dimension in which the cells are neighbors. This constraint
( F% I" ]5 t: i' y+ e, k must hold true for neighboring cells along all of the cell array's+ P; G$ d6 M9 [/ P
dimensions.- ^+ Y2 H. z- `0 K. J" F' Y! S
- P/ [! y) R% H: B- {
The dimensionality of M, i.e. the number of dimensions of M, will match
" N+ l4 N: e# j$ e" H the highest dimensionality contained in the cell array.
* f9 h I2 o) \- P# T/ b
: X/ ^% `9 F" y# V. V0 a CELL2MAT is not supported for cell arrays containing cell arrays or* a+ b2 N5 S. @
objects.7 [9 t% ~+ t0 u) }; c
, h2 S: }2 ]! t7 f) t) [ @ Example:2 g. W9 }% X$ V3 L
C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
- i) @5 s& w) L: ~ M = cell2mat(C)6 a% }! h: g5 \0 N; K
) I7 T. w& w2 f* I V9 {
See also mat2cell, num2cell
; o8 ]$ P' N! ?" [2 `
1 R2 B& y2 i" C Overloaded methods:, @) L* l! }* t2 t0 Q& b3 H$ w; I0 P
distributed/cell2mat# ^& J( T: M% s/ k2 T
5 v: }) E d2 T; |3 t% p Reference page in Help browser
( H4 ]! @9 K- _0 ~ t: | doc cell2mat |
|