Borrar filtros
Borrar filtros

Remove Duplicates from Cell Array

129 visualizaciones (últimos 30 días)
Ammar Taha
Ammar Taha el 21 de Nov. de 2020
Comentada: Ammar Taha el 21 de Nov. de 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

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by