Skip to content

num2cell

builtin · libnexusinterp/corefcn/cellfun-proprietary.cc

: C = num2cell (A)
: C = num2cell (A, dims)

Convert an array into a cell array.

With one argument C has the size of A and C{k} holds A(k). With dims, a vector of strictly increasing dimensions, those dimensions are kept inside each cell: C has the size of A with those dimensions set to 1 and every cell holds the corresponding slice.