|
CELL2MAT Convert the contents of a cell array into a single matrix.1 U7 |, |5 h3 p4 m, ]! O
M = CELL2MAT(C) converts a multidimensional cell array with contents of
, y$ v6 d& q5 T/ i% g9 i7 \ the same data type into a single matrix. The contents of C must be able) h" d* |. N! o* [
to concatenate into a hyperrectangle. Moreover, for each pair of) y" ~4 [. f ~
neighboring cells, the dimensions of the cell's contents must match,7 W( l l( E9 G* b6 t
excluding the dimension in which the cells are neighbors. This constraint
. h# c" D; E0 F1 A2 s must hold true for neighboring cells along all of the cell array's" K) o" j; y& `7 ^
dimensions.% } {: U7 M- U1 a
4 f. G' t% Y' n# q
The dimensionality of M, i.e. the number of dimensions of M, will match1 I7 L+ `3 P3 P2 N5 j/ g4 M
the highest dimensionality contained in the cell array.5 P# p, F& V* @: I9 D; G
Z7 w8 Y+ b0 M& Y CELL2MAT is not supported for cell arrays containing cell arrays or7 S7 w( n: S: W0 Q2 r3 s
objects.' o Y: q' z6 ]# i) L# ]
k7 b% I, ^; x# ?% g: D
Example:4 Z% {% ~! _2 m8 J, p# t, Q
C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};5 `* H! Y5 I3 E' y2 Q) T
M = cell2mat(C)
; S( G; n' T4 E' I: I, J) [
9 \; ^* J& P9 w1 Y6 u0 T) j See also mat2cell, num2cell
+ a; H0 ]; z. W4 J0 G% o. ?( `! v+ f2 r4 x: T' ?5 L0 L% {
Overloaded methods:
3 e" c$ e7 D+ k3 u3 I( q) L/ P distributed/cell2mat2 _# t8 R6 {% G# [
( Y V: `3 p+ S- }. L6 z
Reference page in Help browser2 `9 Q1 l, T9 O4 i: a
doc cell2mat |
|