Azzera filtri
Azzera filtri

Remove Duplicates from Cell Array

129 visualizzazioni (ultimi 30 giorni)
Ammar Taha
Ammar Taha il 21 Nov 2020
Commentato: Ammar Taha il 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

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Programming in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by