Counting number of each characters in a given textfile
Afficher commentaires plus anciens
Hello everyone, i am trying find a solution to count the number of each character(alphabet) . I have to find how many times each elements of alphabet used in a given textfile saved on my pc. Ok i found number of all characters but i do not know how to specify code for 'each' elements used in textfile. I have to show these numbers on histogram by comparing the avarege of each character. For ins. : 'e' is used 12 times in a textfile which has 100 characters and 'b' is used 14 times in a textfile and then histogram must be distribution of each elements.Please i am stuck help me. Thank in advance.
Réponses (1)
Walter Roberson
le 25 Fév 2012
0 votes
Read the entire file in to one string, and run the histogram and that string.
Hint: the maximum possible character value in MATLAB is 65535.
Catégories
En savoir plus sur Text Data Preparation 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!