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
s((L^0.5*512)*(i-1)+L*(j-1)+(L^0.5)*(k-1)+l)=I1(sqrt(L)*(i-1)+k,
sqrt(L)*(j-1)+l); "
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.
Thanks,
Nidhi