フィルターのクリア

Find count of repeated letters

1 回表示 (過去 30 日間)
Jothi
Jothi 2013 年 9 月 30 日
コメント済み: Jothi 2013 年 10 月 7 日
Sir,
How to find the no. of repeated sequence (letters) in the given sentence.
for example, a="I want THAAAAAT APPPPPLE ):):):";
The No. of repeated sequences are: 3
ie.,
1. THAAAAAT
2. APPPPPLE
3. ):):):
thanks

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 9 月 30 日
a='I want THAAAAAT APPPPPLE ):):):'
s=regexp(a,'\s+','split')
out=s(~cellfun(@(x) numel(unique(x))==numel(x),s))
  3 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 1 日
In totally, ll are not repeated letter?
Jothi
Jothi 2013 年 10 月 7 日
But one problem sir,
The input file is ,
a='I want THAAAAAT APPPPPLE ):):): totally unprepared'
In this input we get
out =
'THAAAAAT' 'APPPPPLE' '):):):' 'totally' 'unprepared'
But the required output is,
out =
'THAAAAAT' 'APPPPPLE' '):):):'
how to solve this problem.
thank you sir.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by