mat2cell
Split a matrix into a cell array of sub-matrices.
Syntax
Section titled “Syntax”c = mat2cell(x, m, n, ...)Description
Section titled “Description”Splits matrix x into a cell array of blocks, where the row-block sizes are given by m, the column-block sizes by n, etc. Each m/n argument is a vector summing to the corresponding dimension of x.
Example
Section titled “Example”mat2cell(magic(4), [2 2], [2 2]) % 2×2 cell of 2×2 blocks