Effacer les filtres
Effacer les filtres

How to create a frequency table using a list of string values

2 vues (au cours des 30 derniers jours)
Diana Krupnik
Diana Krupnik le 6 Déc 2018
Commenté : Star Strider le 9 Déc 2018
Hello,
I have a list of 6,057,936 string values, some are unique, many are repeated multiple times. I need to create a table that lists each unique string (likely 1,000-2,000), as well as the number of times this string occurs. Could anyone help me to do this in Matlab?
Thank you,
Diana

Réponse acceptée

Star Strider
Star Strider le 6 Déc 2018
I would use unique and accumarray. An example is given in the documentation section Count of Unique Elements (link).
  2 commentaires
Diana Krupnik
Diana Krupnik le 9 Déc 2018
This is a great idea, but for my dataset (text string array) accumarray was not working unfortunately. What did work was the summary function. It returned fields for categories (same result as unique) as well as counts.
Thanks again,
Diana
Star Strider
Star Strider le 9 Déc 2018
As always, my pleasure.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by