Using this " imshow(pixel_labels,[]), title('image labeled by cluster index');" command, I can see the bw image based on its clustered index. For example K = 3, there will be three index values. If K=6, there will be six index values.

My question is that is there any way to see this image as a color picture.I mean if K=3, currently, it shows that K=1, almost black, if K=2 then grey, if K=3 then white.. something like this.

But is it possible to show for example, when K=1, red, if k=2, blue, if K=3 green, etc..

So, I would like to see as a color clustered index image instead of bw image. I tried to do it by changing the value in [].. but, it doesn't work for me.Anybody knows this?