Applying k means to matrix
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 27 Nov 2012
Okay, go ahead. The function name is kmeans()
Pat
le 27 Nov 2012
Walter Roberson
le 27 Nov 2012
You are overwriting "f" on each iteration of the loop.
What do the arguments "2" and "z2(i)" represent to you?
Pat
le 27 Nov 2012
Modifié(e) : Walter Roberson
le 27 Nov 2012
Pat
le 27 Nov 2012
Walter Roberson
le 27 Nov 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
le 27 Nov 2012
Walter Roberson
le 27 Nov 2012
Time for you to re-read the documentation for kmeans to see what arguments it expects to be passed in.
Pat
le 27 Nov 2012
Walter Roberson
le 27 Nov 2012
Okay, so what is your current version of the code (after taking the documentation into account) ?
Pat
le 27 Nov 2012
Réponses (0)
Catégories
En savoir plus sur Neighborhood and Block Processing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!