How to isolate duplicate strings in cell array?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Janani Guru
le 28 Mar 2022
Réponse apportée : Mathieu NOE
le 28 Mar 2022
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 commentaires
Réponse acceptée
Mathieu NOE
le 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur String Parsing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!