|
|
CELL2MAT Convert the contents of a cell array into a single matrix.. Y# u5 K" _1 J% V' [6 m. D5 _
M = CELL2MAT(C) converts a multidimensional cell array with contents of; E6 U1 I/ e, B
the same data type into a single matrix. The contents of C must be able
( |/ M# B6 U3 s1 t0 n3 F0 d, N% H to concatenate into a hyperrectangle. Moreover, for each pair of2 i4 J9 i' r! K0 b6 F; y
neighboring cells, the dimensions of the cell's contents must match," ]' @& U; l1 J( z" X2 u6 p
excluding the dimension in which the cells are neighbors. This constraint2 c# \) r' A1 N1 N
must hold true for neighboring cells along all of the cell array's6 N" |+ q9 l) X+ ~
dimensions.
* G+ ^3 v6 h! f6 b+ Y( M5 q5 S1 L; I( b
The dimensionality of M, i.e. the number of dimensions of M, will match
7 U& ~7 e, C+ |. f' M o/ y the highest dimensionality contained in the cell array.6 O. J9 c) V2 Y$ L2 l9 C
8 r+ ^* W' ], S
CELL2MAT is not supported for cell arrays containing cell arrays or
2 @; f* k- T% w) R0 r$ y objects.$ X* E' a. U' a0 `7 P& Z/ g5 j
6 ~/ i ?0 |1 }+ |: d
Example:
2 q! L' P) U7 f5 s, I C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
* y+ h) p+ _, k8 c" Q M = cell2mat(C)
+ p. K0 ]6 i0 ]. @4 |; X
2 }$ Z3 R) Q& a/ S2 W4 Z/ e See also mat2cell, num2cell
; r9 B- b. U0 ~- R9 G( }# q' _4 b; K7 L1 i! e% Z7 d6 s M
Overloaded methods:
+ c4 H4 o& K7 a- I9 k- f: E5 ` distributed/cell2mat8 B e* U3 `% \" x
* z$ _9 n" Y" b% R0 R9 [2 M d
Reference page in Help browser R$ d2 g7 C c) N
doc cell2mat9 W5 l, f% h% N5 w3 }) i3 P3 ?! t
|
|