how to compare letters of a word with one another to check reoccurrence of a character?

3 次查看(过去 30 天)
i am working on an algo to watermark text documents using multiple occurrences of letters and need to calculate re- occurrence of a character in a word.any help i have read the text file sentence by sentence and also found no of words per each sentence now i want to store all the words in a sentence in a separate array and then for all the words in a sentence match the first letter of each word with all the remaining letters of the same word to check re occurrence. for example if the sentence is 'text watermarking is difficult' then t occurs two times in text and r occur two times in watermarking so the requires or desired output would be 'twd'.i hope now u can understand what i am trying to ask
  1 个评论
Jan
Jan 2013-6-17
This is a vague question only. Could you explain any details? Some examples might reveal, what you want to achieve.
Please insert them in the original question and not in the comment or answers section.

请先登录,再进行评论。

回答(1 个)

Jan
Jan 2013-6-18
str = 'statement';
pool = unique(str);
count = histc(str, pool);

标签

Community Treasure Hunt

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

Start Hunting!

Translated by