|
CELL2MAT Convert the contents of a cell array into a single matrix.
0 R. O% k6 N' E9 d+ K" a M = CELL2MAT(C) converts a multidimensional cell array with contents of
9 f, F/ `+ s5 c e1 l2 L the same data type into a single matrix. The contents of C must be able
7 d1 K% Q; X$ y. s to concatenate into a hyperrectangle. Moreover, for each pair of
% x! U; Q% s/ C% F% k5 B neighboring cells, the dimensions of the cell's contents must match,: _) V" }" {+ N: d) j0 e, r+ X
excluding the dimension in which the cells are neighbors. This constraint& n# n$ O% i( T% i0 s- W* m
must hold true for neighboring cells along all of the cell array's
0 F+ u) k! |, h/ _/ r( P dimensions.- \$ U/ {- n* t# `# h) o r J
* Z4 ]1 y& _, ~
The dimensionality of M, i.e. the number of dimensions of M, will match
1 _2 E' v# G- p: i3 }" | the highest dimensionality contained in the cell array.
. L" F( R' W1 ?6 g! W; `# G( x6 {0 Z# B( l5 x6 m6 C' p6 ?
CELL2MAT is not supported for cell arrays containing cell arrays or
' Q8 w; B- E& n- C objects.
( M. H! j8 T' `% Q) Y% g! c, ?$ n2 ^( |& O- ^4 A% W0 w2 e& X& Z
Example:
{& I( z8 l, y. i; c C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};& P/ R0 l! a: L$ L8 l
M = cell2mat(C)
9 ^# l! m/ G g n' n0 u* g8 Y! I. p( l) F
See also mat2cell, num2cell1 K: `+ i) Z+ P4 O C& [9 x
6 D4 o; \, r8 _ Overloaded methods:
) L" _# ^6 s: d9 X: F/ I) q distributed/cell2mat# S9 B; u1 d1 [7 I5 E0 h' @
$ Y4 I: w ~7 _' k. f9 P" o, m Reference page in Help browser; J" Y% Q; \ ]6 W: Q; d/ k
doc cell2mat7 T" r% K& h2 G2 u3 Q
|
|