Navigation

Operators and Keywords

Function List:

C++ API

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

Convert the numeric matrix A to a cell array.

If dim is defined, the value C is of dimension 1 in this dimension and the elements of A are placed into C in slices. For example:

num2cell ([1,2;3,4])
  ⇒
     {
       [1,1] =  1
       [2,1] =  3
       [1,2] =  2
       [2,2] =  4
     }
num2cell ([1,2;3,4],1)
  ⇒
     {
       [1,1] =
          1
          3
       [1,2] =
          2
          4
     }

See also: mat2cell.

Package: octave