String Letter Counter Function

This function returns comma separated unique letter counts in an input string, keeping the order.

You are now following this Submission

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 (2026). String Letter Counter Function (https://www.mathworks.com/matlabcentral/fileexchange/26295-string-letter-counter-function), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.0.0

Fixed printing of a local variable.

1.0.0.0