If I have a cell
x=
'sat'
'satire'
'sa'
'do'
How would I list all the unique letters that appear from the list so say uniqueletters='satiredo'

 채택된 답변

Geoff Hayes
Geoff Hayes 2015년 11월 8일

0 개 추천

Max - is the order in your output important? If you use first convert your cell array of strings to a single string using strjoin and then use unique to determine the unique characters, you would get
unique(strrep(strjoin(x'),' ',''))
ans =
adeiorst
Note that we use strrep to replace/remove all the space characters in the joined string.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

질문:

Max
2015년 11월 8일

답변:

2015년 11월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by