Hi Fasil
As per my understanding, you want to segment the image using blkproc()
The syntax of blockproc is:
B = blockproc(A,[m n],fun)
You can also look at this link for demonstrations on how to use blockproc(): https://in.mathworks.com/matlabcentral/answers/223978-how-to-divide-an-image-into-blocks#answer_183445