|
|
CELL2MAT Convert the contents of a cell array into a single matrix.
8 b) c, `/ Y) g6 ? M = CELL2MAT(C) converts a multidimensional cell array with contents of; P% X S. ` `7 h$ E8 q& G
the same data type into a single matrix. The contents of C must be able4 R5 n: | u' K. w2 f. t
to concatenate into a hyperrectangle. Moreover, for each pair of! O! I- I' V1 q. U; H
neighboring cells, the dimensions of the cell's contents must match,! s0 [8 I9 n' W! i
excluding the dimension in which the cells are neighbors. This constraint! J4 b! b9 E9 d7 F# E) N
must hold true for neighboring cells along all of the cell array's
* j7 C* g1 e( O7 F* D dimensions. S/ F- @. t K+ X) c
d" q3 u; M. e# y; m: U
The dimensionality of M, i.e. the number of dimensions of M, will match9 T! i+ y, [: P
the highest dimensionality contained in the cell array.
% K+ H8 G" F. _2 f V6 ~$ D& s
! B6 x# ?+ }. V% ~ CELL2MAT is not supported for cell arrays containing cell arrays or
; U2 ?5 s. q9 Q/ \5 R! o4 m objects.
J, l0 G0 F, n% T9 x1 M* N) n
8 c! H; _9 L7 ]$ l* w Example:: B: k* t; w4 T; ]1 h ~2 \* B
C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};8 E$ w' P9 q! |! ?% D
M = cell2mat(C)4 t! [" @7 O7 Y- d7 m" d
! O( q% l1 m% J. r5 T0 _
See also mat2cell, num2cell
5 F s3 D3 r% E7 }! w
( B/ z4 s, s" [* g Overloaded methods:
( [0 X) C, ~4 s o distributed/cell2mat
- L4 t1 E6 ^: I% B* d: I+ V$ w* ?: k. G0 m, b' l& S( D
Reference page in Help browser
' k8 m1 b9 w4 o. D1 \ doc cell2mat |
|