|
|
CELL2MAT Convert the contents of a cell array into a single matrix.& Q" O" H" ]% Q8 n1 T
M = CELL2MAT(C) converts a multidimensional cell array with contents of
) T" S% {! C8 |4 O3 p! U the same data type into a single matrix. The contents of C must be able' W7 Z/ {0 W2 A8 m' ~
to concatenate into a hyperrectangle. Moreover, for each pair of
, k, D0 w9 _! F* m# h4 W9 I neighboring cells, the dimensions of the cell's contents must match,
' G3 v! H L& v7 Q& y" } excluding the dimension in which the cells are neighbors. This constraint" ~0 o5 y: @6 T
must hold true for neighboring cells along all of the cell array's
( {1 ^9 G3 `7 a+ U/ t. c f* Q# j dimensions.9 f& f" F# w! m4 g
' H" U+ V! G% k* _6 \
The dimensionality of M, i.e. the number of dimensions of M, will match
+ v/ l% Y; E! G! T the highest dimensionality contained in the cell array.5 N3 C+ _: \' A9 F/ r
5 k9 t( B+ T1 n. r9 f6 {( F, u
CELL2MAT is not supported for cell arrays containing cell arrays or7 B. v* i) m- \: O; X a
objects.
, o* [/ n* Z5 e$ w9 Q) v
+ ~0 Y9 _4 x. C Example:
" }! }. Z/ y; ] Q C = {[1] [2 3 4]; [5; 9] [6 7 8; 10 11 12]};+ x _! q/ ^( H
M = cell2mat(C)* J' e* A2 o! r8 N) f d
, V8 [0 q7 C1 l& Q2 U
See also mat2cell, num2cell
/ z8 K+ s. J! x; s: l# ~
; u: {6 A9 Q5 \7 k Overloaded methods:6 ~0 a v5 \+ ~# N' @ o5 C
distributed/cell2mat% w5 n- e. u8 }- q# s
. a- W. u' y" C. h" s G, ?( d9 c
Reference page in Help browser8 T1 a' o# a, y/ @8 O* k
doc cell2mat |
|