error in kmeans

2 visualizaciones (últimos 30 días)
FIR
FIR el 25 de Feb. de 2012
I have 10 images i tried using
[IDX,C] = kmeans(I,10)
but i get error
Class of operand is not supported.
please help
for x = 1:length(dirlist)
I = (imread([pathname, dirlist(x).name]));
I=rgb2gray(I);
I =imresize(I ,[512 512]);
size(I);
[IDX,C] = kmeans(I,10)

Respuestas (1)

Wayne King
Wayne King el 25 de Feb. de 2012
What version of MATLAB are you using? Are you sure you are using a MathWorks' version of kmeans.m? If you enter:
>>which kmeans
what do you get returned? Is it something like:
toolbox\stats\stats\kmeans.m
At any rate, try:
[IDX,C] = kmeans(double(I),10);

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by