|
|
CELL2MAT Convert the contents of a cell array into a single matrix.3 s# W4 P5 J; b& q4 D8 a: `3 F `
M = CELL2MAT(C) converts a multidimensional cell array with contents of5 v& P: W* A& _8 s5 A$ ?' D0 _
the same data type into a single matrix. The contents of C must be able
x* n2 t2 _+ @ to concatenate into a hyperrectangle. Moreover, for each pair of1 A: c6 g- a5 [# {
neighboring cells, the dimensions of the cell's contents must match,9 `0 _5 v1 r p( W2 Z, g( ~
excluding the dimension in which the cells are neighbors. This constraint
9 X* Q- t& k* e. I must hold true for neighboring cells along all of the cell array's
) c3 L. o. F1 [" \5 W4 H5 [1 l$ ^ dimensions.% o( w* O$ f, r9 Y, N5 g% @
9 F( F( T" V4 B7 A# c* U
The dimensionality of M, i.e. the number of dimensions of M, will match
) ~( x9 k7 Y0 x the highest dimensionality contained in the cell array.) j. \; q1 j6 Z3 m
$ `* A" T2 V1 q
CELL2MAT is not supported for cell arrays containing cell arrays or6 u4 O0 c" C( g$ Q: R
objects.
: C( l7 u2 \% Q. n7 z5 C/ W/ O/ k+ |0 R5 ~2 q0 t3 \# o
Example:
. V7 z6 A) K7 ~9 i% x3 }! R C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
" v. H& F7 @8 F6 ~6 l- _) J M = cell2mat(C)" {$ U+ l1 D' N8 }" w! Q" U
/ ^5 }* r) R: m9 c# z1 X/ P
See also mat2cell, num2cell
( y9 G+ `' s$ ]; y% [* f$ R* i) L( G0 w: z g: ]
Overloaded methods:
2 X+ d3 O7 R, ?" c6 T distributed/cell2mat9 V# q+ ?3 a, t; C/ }' b
9 K: d% M* y$ I! D, \; ?
Reference page in Help browser
# c! j4 L$ C3 e; k0 V7 T doc cell2mat |
|