Hey guys. Ive been having problems with something. Im trying to load a picture and put random dots on a square part of that image. Right now I got it to put dots on the whole image but I cant seem to get it to just a certain section of rows and columns. My code is the following:

img = imread('image.png','png');
[X,map] = rgb2ind(img,256);

This code will create 200 random white dots on the image.

Whenever I try to get a certain square section out of the image, it only shows that section and not the entire image. Any suggestions?? Thanks in advance