From: Hizmawati on
hi,

i try to run this code at certain images of .png format :

img1=imresize(img,[100,100]);
[n m]=size(img1);
cellsize=50;
sub_cell=mat2cell(img1, [cellsize*ones(1,n/cellsize)], [cellsize*ones(1,n/cellsize)]);

Then I got this error:
??? Error using ==> mat2cell at 96
Number of input vector arguments, 2, does not match the input matrix's number of dimensions, 3.

Then I try to solve based on previous thread (http://www.mathworks.co.jp/matlabcentral/newsreader/view_thread/242748), where I write it as:

img1=imresize(img,[100,100]);
[n m]=size(img1);
cellsize=50;
sub_cell=mat2cell(img1, [cellsize*ones(1,n/cellsize)], [cellsize*ones(1,n/cellsize)], 3);

I got the result, but when I run to different image I still got error with different dimensional argument.

And the error is:
??? Error using ==> mat2cell at 96
Number of input vector arguments, 3, does not match the input matrix's number of dimensions, 2.

How to handle multi-dimensional argument in matt2cell??
Any workaround this error would be appreciated, please !

-iezma-