|
|
CELL2MAT Convert the contents of a cell array into a single matrix.# C- F& v4 T9 P( m) _) ^
M = CELL2MAT(C) converts a multidimensional cell array with contents of. P) m' P7 y; d/ H- ?% v3 o# @
the same data type into a single matrix. The contents of C must be able/ `3 |$ u( M( z
to concatenate into a hyperrectangle. Moreover, for each pair of& x D1 B' Z6 w& `3 n C' d, W
neighboring cells, the dimensions of the cell's contents must match,. P# \+ _# j6 n1 S$ ?
excluding the dimension in which the cells are neighbors. This constraint
5 J) X7 X: n# Z( L6 o must hold true for neighboring cells along all of the cell array's% g" F- @+ s# i* {' O" N
dimensions.
! m, c! G+ h/ K9 W. [" a+ V% l: f/ Z5 A+ _2 Y X' \) R
The dimensionality of M, i.e. the number of dimensions of M, will match, @; p/ K5 c& L; F
the highest dimensionality contained in the cell array.1 b9 {0 U! Z9 @+ b4 {* x
# c( B c: j* R CELL2MAT is not supported for cell arrays containing cell arrays or
5 N, d4 e6 D2 f objects.7 o0 p& z9 K, M7 E
+ X$ Z# W- t/ F% \/ g Example:8 n, ~# K7 U$ M) b D' D2 y
C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};
* m% f1 k' @% U9 v M = cell2mat(C)
7 |6 v/ c+ L/ e/ g) ?& Q ~+ W% j' T! M& a
See also mat2cell, num2cell2 s1 |9 J6 |2 F! G; ]5 b
0 a% i, b$ \* n Overloaded methods:
1 I) k& Z, \( p- S9 G5 M# m( V distributed/cell2mat) W9 R" o% Z5 o1 k3 d
& F/ h$ \5 _7 W% \3 s Reference page in Help browser# w9 \" R" }; a* m, [
doc cell2mat
* b. v' i. }4 ?: D- u7 a |
|