Eliminating duplicated values in a cell Array

조회 수: 1 (최근 30일)
Deon Hargrove
Deon Hargrove 2020년 3월 4일
댓글: Deon Hargrove 2020년 3월 4일
My cel Array looks as such:
S = {'ABS' ; 'First'; 'input'; 'ABS'}
it is a column array instead of a row. I want to eliminate any and all duplicate values in the cell array. I tried the unique function with and without cell2mat and I am getting an error both ways. What is the best way I can go about eliminating duplicate values in my cell array?

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2020년 3월 4일
편집: KALYAN ACHARJYA 2020년 3월 4일
S = {'ABS' ; 'First'; 'input'; 'ABS'};
result=unique(S)
result
result =
3×1 cell array
'ABS'
'First'
'input'
  댓글 수: 5
Stephen23
Stephen23 2020년 3월 4일
@Deon Hargrove: please upload the cell array in a .mat file by clicking the paperclip button.
Deon Hargrove
Deon Hargrove 2020년 3월 4일
here it is

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by