Counting number of each characters in a given textfile
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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.
0 Kommentare
Antworten (1)
Walter Roberson
am 25 Feb. 2012
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.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Text Files finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!