|
CELL2MAT Convert the contents of a cell array into a single matrix." A% B- D1 P5 H
M = CELL2MAT(C) converts a multidimensional cell array with contents of
8 r, L+ W" E$ f. P/ h& a/ Y1 M; O the same data type into a single matrix. The contents of C must be able# y1 M! h: X3 J& k4 Z0 t0 I
to concatenate into a hyperrectangle. Moreover, for each pair of
2 W8 y9 s" j2 k; s' H) M neighboring cells, the dimensions of the cell's contents must match,
$ ^) ~: O0 a1 x5 f6 X# { excluding the dimension in which the cells are neighbors. This constraint
6 @0 W8 |& R O: w2 j9 b4 } must hold true for neighboring cells along all of the cell array's: Q) [; Z7 V( [- ~7 [0 v/ Z T$ }
dimensions.
# i- b: W* U, t4 W7 [
2 U" J0 ]0 o$ Y+ a. i$ E3 n The dimensionality of M, i.e. the number of dimensions of M, will match; R( M( T$ X& n$ G& j
the highest dimensionality contained in the cell array.
6 ?- o. M7 Y' L5 \" Q5 m
) N" B% Q. g" T+ p) R# Y CELL2MAT is not supported for cell arrays containing cell arrays or- w" F* P& k0 v" q
objects.
% A X) K7 ]0 J5 h9 W
, E9 \& v2 O s- _# M Example:& e4 X: p } [( q7 p
C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
% ]- c7 o. o" L7 S4 Q ~* w& b M = cell2mat(C)+ t' q8 T) A: t8 ]3 f
: T9 Y, m( w1 g2 c- S6 G% g0 { See also mat2cell, num2cell
6 e4 `2 [8 o x; y0 \- ?4 x' S- \( [ t! n2 [/ a4 A
Overloaded methods:8 z6 K/ W5 X% a! r
distributed/cell2mat
8 E& `& i! ^( A4 \+ N* d
# K1 q3 l7 W! I. [5 P, R% K) B Reference page in Help browser- K: y& q* c- K$ P8 Y) p6 V; a& f
doc cell2mat |
|