Code covered by the BSD License  

Highlights from
Split nD-array into equal sized cells

Be the first to rate this file! 26 Downloads (last 30 days) File Size: 1.64 KB File ID: #35085 Version: 1.0

Split nD-array into equal sized cells


Matt J (view profile)


Splits an array of any dimension into cell array of equal sized chunks.

| Watch this File

File Information

MAT2TILES is basically a wrapper for mat2cell but with a more convenient interface when you are simply trying to decompose an N-dimensional array into equal-sized chunks. It takes the desired chunk-size as an input argument, whereas mat2cell does not. MAT2TILES also has some convenient shortcuts for when you only want to tile along particular dimensions (see below).

will produce a cell array C containing adjacent chunks of the array X, with each chunk of dimensions D1xD2xD3x...xDn. If a dimension Di does not divide evenly into size(X,i), then the chunks at the upper boundary of X along dimension i will be truncated.
It is permissible for the Di to be given value Inf. When this is done, it is equivalent to setting Di=size(X,i). This is useful if you want to tile along only certain array dimensions.
If n < ndims(X), then the unspecified dimensions Dj, n<j<=ndims(X) will be
set to size(X,i).
If n > ndims(X), the the extra dimensions Dj, j>ndims(X) will be ignored.

MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us