num2cell
Convert a numeric array to a cell array.
Syntax
Section titled “Syntax”c = num2cell(A)c = num2cell(A, dims)Description
Section titled “Description”Wraps each element of A in its own cell. With dims, groups elements together along the specified dimensions before wrapping.
Examples
Section titled “Examples”num2cell([1 2; 3 4]) % {1, 2; 3, 4}num2cell([1 2; 3 4], 1) % {[1; 3], [2; 4]} each col in one cell