How to isolate duplicate strings in cell array?
8 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Mathieu NOE
2022-3-28
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String Parsing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!