필터 지우기
필터 지우기

Remove Duplicates from Cell Array

조회 수: 129 (최근 30일)
Ammar Taha
Ammar Taha 2020년 11월 21일
댓글: Ammar Taha 2020년 11월 21일
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일
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개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by