matlab divide matrix up into smaller matrix
===

Hi I have a matrix A size ixi, and i want to divide it into smaller matrices such that each sub matrix fits the dimensions of matrix B size jxj. How do I do this?

    B = mat2cell(A,size(B));

doesn't seem to do it.

note: the number of sub matrices = sqrt(n)  i.e. if A is 100x100 then there will be 10 sub matrices, If A is 81x81 there will be 9 sub matrices.

Thanks 