MATLAB: Split a matrix into smaller sub matricies

mat2cell quiver ones

I've seen this answered on the web many times but none of the answers seem to give me what I need, so here it goes…
As a simple example, I have a 100×100 matrix
if true
x = ones(100)
% code
end
I would like to split this into 100 sub matrices, of size 10×10.
I would then like to sum each element of each sub matrix to give me a 10×10 matrix of these sums.
I am using these Matrices I quiver3 after this so I cannot use the mat2cell (as far as I understand) function to manipulate them into sizes I want.
Any suggestions appreciated, as always, thanks in advance for your help. John.

Best Answer

Using SEPBLOCKFUN ( Download )
result = sepblockfun(yourMatrix, [10,10], 'sum');