|
CELL2MAT Convert the contents of a cell array into a single matrix." v1 z! Q2 p! g. w ~6 N; Y, E
M = CELL2MAT(C) converts a multidimensional cell array with contents of t! \' X. q( ]) H( n
the same data type into a single matrix. The contents of C must be able3 q. Y% l) v, o! q6 z/ T
to concatenate into a hyperrectangle. Moreover, for each pair of0 p% p; F* C, T) s
neighboring cells, the dimensions of the cell's contents must match,- A; H3 c0 ]# G; j v
excluding the dimension in which the cells are neighbors. This constraint' W/ [+ h7 e4 I
must hold true for neighboring cells along all of the cell array's# B% G6 D: X/ j8 B& f0 i: ?
dimensions.
7 l) y. X8 A2 m: S
4 y/ D; f4 B. J) M% h0 I: B2 f The dimensionality of M, i.e. the number of dimensions of M, will match
4 B. X2 [6 _1 ?2 m2 q( |- g4 Y the highest dimensionality contained in the cell array.
7 e) ] k0 H1 L4 J- t+ E/ i
# T% X3 s% I s* K CELL2MAT is not supported for cell arrays containing cell arrays or
t4 s9 c/ i% Q/ }' F7 E4 i" Q0 e objects.
. Y* S4 P' f. c1 r2 X) {( M. G# Z
. P2 r& e9 n/ A" P6 U4 ^0 j Example:; e3 [9 b* }% i7 }& y
C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};9 t: i( z! T/ d: {: q5 q, v
M = cell2mat(C)
9 C4 Z7 z. A7 S) s1 x, t9 D' A2 |4 B
See also mat2cell, num2cell
8 S" B) x0 f' f' G0 |6 Q3 H7 r/ e2 q+ h% t7 u6 _( q7 J1 q6 _' R9 @( S) ^; c
Overloaded methods:2 I, U! d- j5 @& W& p8 O
distributed/cell2mat" N! V. u: H( b9 ^1 Q! n" z/ |' v2 l
0 @5 z/ L8 {0 N- O4 p' B' P Reference page in Help browser, r% \. W1 ~- \, s# x2 g V! r
doc cell2mat% g* X) o! q0 Q3 l
|
|