|
CELL2MAT Convert the contents of a cell array into a single matrix.
- f7 c3 f9 k+ u. ~& {' c4 A, d M = CELL2MAT(C) converts a multidimensional cell array with contents of+ `, G& [* X/ @- }7 Z3 N$ [
the same data type into a single matrix. The contents of C must be able
& n0 L1 L/ _; `: J" p/ ` to concatenate into a hyperrectangle. Moreover, for each pair of
' c, q) {/ |3 {! o+ | neighboring cells, the dimensions of the cell's contents must match,
/ X- [" R- z# N* n excluding the dimension in which the cells are neighbors. This constraint4 P% ^ X8 @! T2 P
must hold true for neighboring cells along all of the cell array's! Z% y' `7 A1 Z' j
dimensions.. o. i0 F0 a& j0 a& g5 X
2 J, D2 h! s G; u! T) I ` The dimensionality of M, i.e. the number of dimensions of M, will match
2 e$ P/ Q8 b8 G) q, H# @+ r, I/ q6 _ the highest dimensionality contained in the cell array.' U' }4 H% D& X2 J3 R6 M- [+ O4 e
( ]: f& g9 b' M3 @
CELL2MAT is not supported for cell arrays containing cell arrays or
6 N. L# F7 E, c% b" I objects.
' v& I9 A( ~5 g4 H5 q0 x$ p
* g. W2 @9 @) x0 ]( j Example:! @3 K" H4 B* E0 N3 ]* R8 m8 |
C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
- }0 @* ~/ I9 X+ O0 ` M = cell2mat(C)
4 n! W: q K# f1 x6 _) g3 S
9 t1 d+ I; e9 m7 M& |+ C See also mat2cell, num2cell7 j0 v0 [* b: C
8 z+ I% \$ G( O% n& T3 W8 m Overloaded methods:! Q* ~9 x7 ?" e% l S
distributed/cell2mat3 y \+ N5 c8 Z( Z" q" S
+ x" p- T' E! i1 a+ b5 x' W; d
Reference page in Help browser1 Y- Y. M/ A" @ r9 U" @( G
doc cell2mat" ^/ H. V( Y5 M
|
|