Click here to Skip to main content
15,886,857 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to implement k-means algorithm in matlab
Posted
Updated 3-Jan-12 23:01pm
v2
Comments
Mehdi Gholam 4-Jan-12 4:58am    
Please do not use UPPERCASE as it is considered rude.

Have a look at this web site: http://www.mathworks.com/matlabcentral/fileexchange/16762-k-means-algorithm-demo[^]. It looks as if it provides what you are looking for.


Regards,


Manfred
 
Share this answer
 
Comments
abhilash5 4-Jan-12 5:35am    
m getting the error as ??? Undefined function or method 'simple_kmeans' for input arguments of type
'double'. wen i tried the demo code of k-means wch ws in th spefied link
Manfred Rudolf Bihy 4-Jan-12 8:44am    
Did you download both files: simple_kmeans and km_demo.m?
If you can't read you really shouldn't be using computers. ;P
:)
abhilash5 9-Jan-12 0:53am    
ya man i knw wat u tellin... thing is m new to matlab.... i have downloaded both th code but wat m askin is hw to run the code n hw to linl demo n simple k-means s=code????
abhilash5 9-Jan-12 1:27am    
> demo
??? Undefined function or variable 'km_demo'.

Error in ==> demo at 1
km_demo.m


proto =

0.1760 6.1238 -0.0857
-0.0483 -0.0681 -0.1050
0.0336 -0.0822 6.0765
6.0401 0.0264 -0.0227


Nproto =

102
198
300
500
ths is hw m gettin wen u run demo.m
and wen i run simple kmeans the error is
??? Input argument "X" is undefined.

Error in ==> simple_kmeans at 2
[Ndata, dims] = size(X);
pls do needfull
You can see Matlab's kmeans, just press 'edit kmeans'.
Here, are a lot of imprementations of kmeans:
http://www.mathworks.com/matlabcentral/fileexchange/index?utf8=%E2%9C%93&term=kmeans
And here is an example how to reduce colors using kmeans:
http://imageprocessingblog.com/?p=178
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900