# MATLAB: How can we slide say a 3X3 window on a matrix and perform an operation (i.e. Sum) on the 3X3 window, and then move that 3X3 window to the next part until we reach the end of the matrix? Thanks.

image processingImage Processing Toolbox

How can we slide say a 3X3 window on a matrix and perform an operation (i.e. Sum) on the 3X3 window, and then move that 3X3 window to the next part until we reach the end of the matrix? Thanks. i have a program of 2X2 but i went 3, thanks.

blurredImage = conv2(double(grayImage), ones(3), 'same');imshow(blurredImage, []);