% ? loads the image 
% ? check whether is it color 
% ? calls your function 
% ? displays the result with the original image

im = imread('market.jpg');
if (size(im,3) ~= 3)
    error('Given image is not an rgb picture!')
end

figure(1)
subplot(1,2,1)
imshow(im)
title('Original image')

subplot(1,2,2)
imshow(k_mean_clustering(im, 30))
title('Clustered image')