How to isolate duplicate strings in cell array?
6 views (last 30 days)
Show older comments
I have a large cell array like:
words =
613×1 cell array
{'still'}
{'while'}
{'until'}
{'light'}
{'still'}
{'built'}
{'field'}
{'child'}
{'build'}
{'liked'}
{'until'}
{'plain'}
{'alike'}
{'alive'}
.
.
.
I am trying to isolate repeat words and output them in my command window
output:
'still'
'until'
How do I go about doing this? I am having issues with the unique function.
Thank you for your help!
0 Comments
Accepted Answer
Mathieu NOE
on 28 Mar 2022
hello
here you are :
a = [ {'still'};
{'while'};
{'until'};
{'light'};
{'still'};
{'built'};
{'field'};
{'child'};
{'build'};
{'liked'};
{'until'};
{'plain'};
{'alike'};
{'alive'}];
[C,IA,IC] = unique(a);
output = a;
output(IA) = [];
0 Comments
More Answers (0)
See Also
Categories
Find more on String Parsing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!