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 Exchange에서 Shifting 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