Effacer les filtres
Effacer les filtres

Count value Frequency From Array For each row, Max Frequency Row

1 vue (au cours des 30 derniers jours)
rizwan
rizwan le 7 Avr 2015
Commenté : Image Analyst le 7 Avr 2015
Hi Experts,
I have an array
a =
0 0 100 100 100 100 100 100 100 100 0 0
0 100 100 100 100 100 100 100 100 100 0 100
0 0 100 100 0 0 100 100 100 100 100 100
I want to count the number of times 100 appears in each row and extract the row number!! In this case we have
Row 1= 8
Row 2= 10
Row 3= 8
Row 2 = 10
Can any one help me to write the code lines to achieve this!!!!!!

Réponse acceptée

Image Analyst
Image Analyst le 7 Avr 2015
Try this
output = sum(a == 100, 2)
  3 commentaires
rizwan
rizwan le 7 Avr 2015
Hi Expert,
I have k mean implementation [idx,C] = adaptcluster_kmeans(I);
i want to show the output of k mean , Please help
Image Analyst
Image Analyst le 7 Avr 2015
I have no idea what you're talking about. I don't know what that matrix has to do with clustering or classifying. What do you want to do with that matrix as far as clustering or classifying goes? Are you sure you commented on the right Answer????
Anyway, I don't have the Statistics and Machine Learning Toolbox (yet). You can find out about kmeans here: http://www.mathworks.com/help/stats/examples/cluster-analysis.html

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by