Filter löschen
Filter löschen

Eliminating duplicated values in a cell Array

1 Ansicht (letzte 30 Tage)
Deon Hargrove
Deon Hargrove am 4 Mär. 2020
Kommentiert: Deon Hargrove am 4 Mär. 2020
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?

Antworten (1)

KALYAN ACHARJYA
KALYAN ACHARJYA am 4 Mär. 2020
Bearbeitet: KALYAN ACHARJYA am 4 Mär. 2020
S = {'ABS' ; 'First'; 'input'; 'ABS'};
result=unique(S)
result
result =
3×1 cell array
'ABS'
'First'
'input'
  5 Kommentare
Stephen23
Stephen23 am 4 Mär. 2020
@Deon Hargrove: please upload the cell array in a .mat file by clicking the paperclip button.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu General Applications finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by