MATLAB Functions | Help Desk |
num2cell
Convert a numeric array into a cell array
c = num2cell(A)
c = num2cell(A,dims
)
c = num2cell(A)
converts the matrix A
into a cell array by placing each element of A
into a separate cell. Cell array c
will be the same size as matrix A
.
c = num2cell(A,dims
)
converts the matrix A
into a cell array by placing the dimensions specified by dims
into separate cells. C
will be the same size as A
except that the dimensions matching dims
will be 1.
The statement
num2cell(A,2)
places the rows of A
into separate cells. Similarly
num2cell(A,[1 3])
places the column-depth pages of A
into separate cells.
cat
Concatenate arrays