To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016
I have to run the K-means clustering program using matlab.
im = imread('D:\lena256.jpg'); k=5; %histogram calculation img_hist = zeros(256,1); hist_value = zeros(256,1); for i=1:256 img_hist(i)=sum(sum(im==(i-1))); end
Run above code the following error occurred.
??? In an assignment A(:) = B, the number of elements in A and B must be the same. Error in ==> kmeansclustering at 10 img_hist(i)=sum(sum(im==(i-1))); Error in ==> main at 5 [clusters, result_image, clusterized_image] = kmeansclustering(im,k);
How do I solve this problem?
im might be a three dimensional matrix.