String Letter Counter Function

This function returns comma separated unique letter counts in an input string, keeping the order.
591 Downloads
Updated 7 Jan 2010

View License

Statement: strLetterCounter('string')
....where, 'string' is an input string containing alphabet or numbers.

Ex: string='aaaaaaaabbbbbbccd'
Statement: strLetterCounter(string)
Output: '8a,6b,2c,1d'

Note: This function is different from the Matlab function called 'unique' because it keeps the order in which letters occur in the string.

Cite As

Avinash Rude (2024). String Letter Counter Function (https://www.mathworks.com/matlabcentral/fileexchange/26295-string-letter-counter-function), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Characters and Strings in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.1.0.0

Fixed printing of a local variable.

1.0.0.0