|
CELL2MAT Convert the contents of a cell array into a single matrix.* r0 {0 ^3 J$ O I
M = CELL2MAT(C) converts a multidimensional cell array with contents of
0 U! c( v# B! H1 M7 G$ d3 J the same data type into a single matrix. The contents of C must be able: _. m$ o1 K, d3 A6 m
to concatenate into a hyperrectangle. Moreover, for each pair of
/ M* H2 N; \4 F' a% L* l neighboring cells, the dimensions of the cell's contents must match,9 o. F3 t% a) o6 m
excluding the dimension in which the cells are neighbors. This constraint% n8 [9 L- ~5 h2 W- o& x( l
must hold true for neighboring cells along all of the cell array's
" @$ s7 _7 m; ?; h* l8 ?1 H, g& e dimensions.$ q! X+ y0 j6 {6 P, M
' ^/ f; f' E8 Z; x% i4 A
The dimensionality of M, i.e. the number of dimensions of M, will match
' u& i: c' {: P" y& a. L2 M the highest dimensionality contained in the cell array.
8 f, C% ` ?: X, t/ O% y: ?- N2 n- B9 f; }4 B
CELL2MAT is not supported for cell arrays containing cell arrays or
6 R1 l, I5 `% ?0 l; N; g: Q objects.! [' Y) ?, r1 D
l( c0 x3 g5 m# r
Example:3 u0 y& ?( |- J& ~
C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
5 W* L, Q1 l0 C5 k" E' N M = cell2mat(C)6 z( k& ^3 I) c- {0 I
; K# {3 g+ s0 I7 H! p" v1 s) h
See also mat2cell, num2cell
' t9 U, w+ Z0 y$ n9 Q4 ?, R' p, d8 E
U1 f- @# P# n Overloaded methods:
' W) r& y0 F" H# S distributed/cell2mat
5 d" B' X5 R1 c
4 @. ]4 M3 j- Q6 W Reference page in Help browser
9 ^8 W* l, E: \3 D doc cell2mat2 B9 h, w t8 }* ]- ~
|
|