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.
r = randi(256-7);
c = randi(256-7);

subblock = I(r:r+7, c:c+7);