I have an RGB image of size 412x550. I want to divide it into sub matrices of size 2x2. I have tried using mat2cell function but it is
412x550
2x2
mat2cell
You should use the function im2col. It is exactly what you need.
im2col
A = rand(412,550); B = im2col(A,[2 2]);
The doc is there:
http://www.mathworks.fr/help/images/ref/im2col.html;jsessionid=4d24325613716d84d4635b4fc636