Effacer les filtres
Effacer les filtres

Remove Duplicates from Cell Array

129 vues (au cours des 30 derniers jours)
Ammar Taha
Ammar Taha le 21 Nov 2020
Commenté : Ammar Taha le 21 Nov 2020
Hello there, if I have a cell array as following:
in which the first column is constructed of type 'char' for each element, how can I extract this first col. without duplicates?
Thanks in Advance

Réponse acceptée

Ameer Hamza
Ameer Hamza le 21 Nov 2020
You can use unique()
C; % your cell array
country_names = unique(C(:,1))
  1 commentaire
Ammar Taha
Ammar Taha le 21 Nov 2020
Thanks a lot, I was confused using unique for the first time.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by