Count Relationships between two columns
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Marcelo Costa
le 23 Juin 2015
Réponse apportée : Walter Roberson
le 23 Juin 2015
I'd like to count how many links a first column number is to a second column number, and so on. For example, how many times the number 1da first column has the number 1 in the second column?
0 commentaires
Réponse acceptée
Walter Roberson
le 23 Juin 2015
maxdata = max(max(Yourdata(:,1:2)));
counts = accumarray(YourData(:,1:2), 1, [maxdata, maxdata]);
Now counts(J,K) is the number of times the number J appeared in the first column with K in the second column of the same row.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Time Series 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!