Thanks for your support. This new code doesnot give the error I got earlier, but the program is busy in its operation and finally it says "elapsed time". The program works for about 21 min approx.
Hope you will help me in resolving this issue.
When I use a .jpg file it says :
"??? Attempted to access I1(1,247); index out of bounds because size(I1)=[185,246].
Error in ==> image_kmeans at 17
I tried changing the size of the image but still it gives the same error. Only the coordinate or pixel value of out of bound changes.
Can you pl. tell me the size of image which I should use.