Problem 45455. Most Frequent Characters
Given a document file or a character array, identify the 'n' most frequently occurring characters and the number of times each appears.
Inputs:
x= 'aaabbc'
n=2
Outputs:
out_1= {'a', 'b'}
out_2 = [3, 2]
- the characters should be returned in a cell array
- the frequency of occurrence should be returned in a numeric array
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers8
Suggested Problems
-
8 Solvers
More from this Author174
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!