|
CELL2MAT Convert the contents of a cell array into a single matrix.
' ~1 T) a4 n* B$ E l* D: }) T- [ M = CELL2MAT(C) converts a multidimensional cell array with contents of
# X8 b! x! R8 S1 b% [2 E the same data type into a single matrix. The contents of C must be able
! S! n0 S K, ~- g7 q to concatenate into a hyperrectangle. Moreover, for each pair of
" Z5 `0 Y) W1 K% z5 d4 E- l neighboring cells, the dimensions of the cell's contents must match,
2 \! E7 h+ I. i: O excluding the dimension in which the cells are neighbors. This constraint
1 Z6 S! I' G, w; j/ j) c. H9 [2 L$ U must hold true for neighboring cells along all of the cell array's
1 W4 j. V0 z: r7 J dimensions.
1 l7 W/ E" x. R6 t: X0 @4 W/ G1 G& o9 @! U3 z+ z) [
The dimensionality of M, i.e. the number of dimensions of M, will match
' G% J. x" X8 h) n0 V) V- [( i7 @ the highest dimensionality contained in the cell array.
; V& c! b7 L9 r3 c. @, P: C6 p4 u5 U. F% K
CELL2MAT is not supported for cell arrays containing cell arrays or
3 w* a. e0 s6 l8 }; @ objects.
. J2 [! B R4 V7 E% U) s( x, |* ^ r6 E- q2 W
Example:
0 n b X0 G2 h" E: r) f C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};! J; s X3 a/ g# W$ J
M = cell2mat(C)! B4 V# L% L- u5 o8 o8 J$ b& `
. w! o3 Y1 t2 e$ ]# _. Y, p' l: Y See also mat2cell, num2cell
% m1 [" T8 D! I! e1 N% E* t8 G' X. I3 i4 J
Overloaded methods:
3 X5 [" {% U3 g1 l' R distributed/cell2mat9 v6 H9 ]3 Z% N0 h+ u; _
3 i$ E! C; J% e8 Z
Reference page in Help browser( I- B; `$ t2 Q' h" `) }
doc cell2mat |
|