|
|
CELL2MAT Convert the contents of a cell array into a single matrix.
$ |+ Q! m9 J" e8 J M = CELL2MAT(C) converts a multidimensional cell array with contents of y1 `* [1 f; A# N% w# r6 C" I0 t
the same data type into a single matrix. The contents of C must be able
1 k. s6 O7 ]/ N9 ?6 R to concatenate into a hyperrectangle. Moreover, for each pair of
4 d! w: m: W1 x! _, H6 c neighboring cells, the dimensions of the cell's contents must match,. c0 f# y8 G8 v1 y+ t$ x
excluding the dimension in which the cells are neighbors. This constraint) d) J: ~ ]4 ` S0 O# K9 ]
must hold true for neighboring cells along all of the cell array's! a8 d3 S1 k1 g1 A
dimensions.$ e$ }+ t3 ^8 @/ w
) q( }+ g$ T+ w7 e The dimensionality of M, i.e. the number of dimensions of M, will match% Y/ K! f0 t o
the highest dimensionality contained in the cell array./ o' J8 L2 | Q' u) d0 {
% W6 A9 u# R8 D2 Q2 _8 l CELL2MAT is not supported for cell arrays containing cell arrays or
u" O; X- M3 t) i7 H) s" U' p objects.
2 Q0 m0 [/ o: F; K4 J r, e7 j
Example:
' r* ?8 T( O9 U C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
) r; G$ X# x- E6 ]) n+ R u" G, P; u M = cell2mat(C)
9 Z: y" a0 t# c: O% m0 e; q, p; V4 T: i; x7 z$ r0 n
See also mat2cell, num2cell
9 R9 {4 b% \1 [7 b$ e' D$ s- l
( t! s! E* ?% x4 ]# U, I Overloaded methods:" f& c, [$ D3 U
distributed/cell2mat
9 K$ W/ v- m" c- ]0 ^$ p/ ~3 _8 L9 I9 X& J. Q. Q( l- b
Reference page in Help browser3 D& S/ T+ t2 Q" @" ~1 l
doc cell2mat |
|