Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Convert array to cell array whose cells contain subarrays

`C = mat2cell(A,dim1Dist,...,dimNDist)`

`C = mat2cell(A,rowDist)`

`C = mat2cell(`

divides array `A`

,`dim1Dist,...,dimNDist`

)`A`

into smaller arrays and returns them in cell array
`C`

. The vectors `dim1Dist,...dimNDist`

specify how to
divide the rows, the columns, and (when applicable) the higher dimensions of
`A`

. The smaller arrays in `C`

can have different sizes.
`A`

can have any data type.