How can I remove duplicate values from cell array?

I have this problem
S={ 1 2, 2 3 }
how delete duplicate value:
S becomes {1 2 3 }

 채택된 답변

Nicolas B.
Nicolas B. 2019년 11월 11일
편집: Nicolas B. 2019년 11월 11일
Does the function unique() solve your problem?
So in your case, because you have a cell array:
S = {1 2 2 3};
S = num2cell(unique(cell2mat(S)));

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

질문:

2019년 11월 11일

편집:

2019년 11월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by