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

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 21 日

2 投票

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

1 件のコメント

Ammar Taha
Ammar Taha 2020 年 11 月 21 日
Thanks a lot, I was confused using unique for the first time.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeShifting and Sorting Matrices についてさらに検索

タグ

質問済み:

2020 年 11 月 21 日

コメント済み:

2020 年 11 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by