# Random selection of sub-block in an image with matlab

I want to select a random sub-block of 8x8 out of an image 256x256. Is there an instruction that do this thing or i need to calculate it with a different approach. I found how to choose a galois field array out of a matrix but i think this is not in my case what i need.

• Very elegant! Just to be picky: it should be $\tt{randi(256-7)}$ and $\tt{I(r:r+7, c:c+7)}$. – Matt L. May 18 '13 at 12:51