How can I remove duplicate values from cell array?

19 ビュー (過去 30 日間)
Mira le
Mira le 2019 年 11 月 11 日
編集済み: Nicolas B. 2019 年 11 月 11 日
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 件)

カテゴリ

Help Center および File ExchangeMultidimensional Arrays についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by