|
|
CELL2MAT Convert the contents of a cell array into a single matrix.
) A5 t" W5 `# M0 a. h M = CELL2MAT(C) converts a multidimensional cell array with contents of2 \7 P4 `- L8 Z4 M1 T
the same data type into a single matrix. The contents of C must be able
# a' w' g8 z2 {. V; R/ i- N to concatenate into a hyperrectangle. Moreover, for each pair of1 [/ v3 f% e) I5 ?
neighboring cells, the dimensions of the cell's contents must match,) ]8 a0 I/ i2 P1 V( U
excluding the dimension in which the cells are neighbors. This constraint
1 L* A S( ~0 T' S$ R1 d must hold true for neighboring cells along all of the cell array's
6 i3 c1 a& B, P' f3 D dimensions.
* D4 l1 f w6 @. ?2 p1 ?' g
/ ]8 q2 j2 x" K; \) y The dimensionality of M, i.e. the number of dimensions of M, will match; u/ t H; Y$ d6 v# M5 v
the highest dimensionality contained in the cell array.
% G3 T' I2 ]1 o2 [# n d% L& l3 F. ~5 x4 s! s" z
CELL2MAT is not supported for cell arrays containing cell arrays or
$ [; J( ^7 s# q0 j( n) k9 ~, w objects.! H0 a' h S! x- X
* X( Y6 y d; L5 H4 \ Example: z+ _6 W O5 F
C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};. O/ W" r, `) l8 Q$ z1 i4 _
M = cell2mat(C)
# w: ^# q$ R8 W7 N' C+ M* u+ `, o# Z1 G' N1 ?- Y8 i1 G( [ z
See also mat2cell, num2cell, W. H0 L. d8 u( W
: v5 E+ i6 I5 t& W/ ^
Overloaded methods:. Z5 ]! J4 n3 v' {, J" X: D( G9 o
distributed/cell2mat
8 B7 @5 o& x. y8 ]3 O6 A
! d# J- z/ h4 k% [" u% t4 S Reference page in Help browser
+ V$ u- y" R+ ]2 H doc cell2mat |
|