Applying k means to matrix
Mostrar comentarios más antiguos
I have the result after dividing same pixels into blocks,
result is in variable out in workspace
27 [1,9]
30 [1,12]
31 [1,13]
32 [1,14]
33 [1,15]
34 [1,16]
35 [1,17]
36 [1,18]
37 [1,19]
38 [1,20]
39 [1,21]
now i have to apply k means for the above result ,i.e for each block i have to apply k means
please help
11 comentarios
Walter Roberson
el 27 de Nov. de 2012
Okay, go ahead. The function name is kmeans()
Pat
el 27 de Nov. de 2012
Walter Roberson
el 27 de Nov. de 2012
You are overwriting "f" on each iteration of the loop.
What do the arguments "2" and "z2(i)" represent to you?
Pat
el 27 de Nov. de 2012
Editada: Walter Roberson
el 27 de Nov. de 2012
Pat
el 27 de Nov. de 2012
Walter Roberson
el 27 de Nov. de 2012
I don't understand what that code is intended to do, and I do not understand how you ended up (in your file) with multiple entries with the same pixel value.
Anyhow, let us stick for the moment with the question of what kmeans(2,z2(i)) means to you. Why is the first argument always 2? Why is the second argument variable? Which argument represents the number of clusters? Which argument represents the data to be clustered?
Pat
el 27 de Nov. de 2012
Walter Roberson
el 27 de Nov. de 2012
Time for you to re-read the documentation for kmeans to see what arguments it expects to be passed in.
Pat
el 27 de Nov. de 2012
Walter Roberson
el 27 de Nov. de 2012
Okay, so what is your current version of the code (after taking the documentation into account) ?
Pat
el 27 de Nov. de 2012
Respuestas (0)
Categorías
Más información sobre Neighborhood and Block Processing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!