|
|
CELL2MAT Convert the contents of a cell array into a single matrix.
' T6 r' b( n0 c/ M$ A6 n" k8 i M = CELL2MAT(C) converts a multidimensional cell array with contents of
2 P) @! m' f: O1 y' w the same data type into a single matrix. The contents of C must be able
+ W5 Y) V% u: `9 j7 v to concatenate into a hyperrectangle. Moreover, for each pair of
/ |$ {# E. \5 O6 T- n neighboring cells, the dimensions of the cell's contents must match,: m, @3 [' b5 x( \' t( P
excluding the dimension in which the cells are neighbors. This constraint
5 C5 e' b! Z, a) ~ must hold true for neighboring cells along all of the cell array's9 ?9 W; s+ c" f* s0 G2 O
dimensions.; C- W/ ?! X! l" J
6 C/ e p: q6 H% r- {+ W* p
The dimensionality of M, i.e. the number of dimensions of M, will match6 I2 F4 C2 I6 A6 p9 w* a
the highest dimensionality contained in the cell array.* ~: l. E3 D% y4 P
& p5 x" W; f' I CELL2MAT is not supported for cell arrays containing cell arrays or
, {" m0 l$ P9 O, E* h' B2 {2 J+ ^ objects.7 _& z, D L2 R, o
! M( z$ b. \& q1 l' T5 C+ W1 ~
Example:
+ J% P+ P$ G7 q6 n C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};5 e6 r4 G9 K9 l6 n3 X7 G1 @2 Q
M = cell2mat(C)+ D ]. F( X/ L' y" T; F
1 y( H; S5 g0 D See also mat2cell, num2cell+ v, S" K& Y; l$ Q! a3 D
" P3 O# x/ Z5 o
Overloaded methods:2 s( d) P5 f/ w- a: n0 V& {
distributed/cell2mat _0 X7 O9 r/ E2 J H$ F
, N, v9 J! K1 \6 q$ ]
Reference page in Help browser
# [: f- J7 m' q$ N doc cell2mat
: t* q7 k& s; A% S0 z$ Q: g |
|