Remove Duplicates from Cell Array

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

 采纳的回答

You can use unique()
C; % your cell array
country_names = unique(C(:,1))

1 个评论

Thanks a lot, I was confused using unique for the first time.

请先登录,再进行评论。

更多回答(0 个)

类别

标签

Community Treasure Hunt

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

Start Hunting!

Translated by