find the number of occurances
    1 vue (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
    johnson saldanha
 le 13 Nov 2018
  
    
    
    
    
    Commenté : johnson saldanha
 le 13 Nov 2018
            my matrix is x=[ 1 1 1 3 3 4 4 4 6 7]
i want the output as y=[ 3 2 3 1 1]
i want to find how many times a particular value is occuring
0 commentaires
Réponse acceptée
Plus de réponses (1)
  madhan ravi
      
      
 le 13 Nov 2018
        x=[ 1 1 1 3 3 4 4 4 6 7]
u = unique(x) %unique numbers
y=histc(x,u) %occurences
bonus = [u; y]' %relation between them
2 commentaires
Voir également
Catégories
				En savoir plus sur Cell Arrays 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!


