How to correct the assignment Error?
조회 수: 4(최근 30일)
I have to run the K-means clustering program using matlab.
im = imread('D:\lena256.jpg');
img_hist = zeros(256,1);
hist_value = zeros(256,1);
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
Error in ==> main at 5
[clusters, result_image, clusterized_image] = kmeansclustering(im,k);
How do I solve this problem?
Jürgen 2012년 12월 14일
there is a function: imhist(I) , quite useful for this work, + if you want to calculate the hist by summing for each value 0=>255 you will get a array with a lenght of 256 not 256*256