finding most common letter in a string
1 回表示 (過去 30 日間)
古いコメントを表示
say I have a string y='asdqwdqwdasasdasdaasasdwdqwd' How do I find the letter that occurs the most in y which is clearly 'a' so have something like mostcommonletter='a'
0 件のコメント
回答 (1 件)
Azzi Abdelmalek
2015 年 11 月 12 日
編集済み: Azzi Abdelmalek
2015 年 11 月 12 日
y='asdqwdqwdasasdasdaasasdwdqwd'
[ii,jj,kk]=unique(y)
a=accumarray(kk,1)
idx=a==max(a)
out=ii(idx)
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Histograms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!