Eliminating duplicated values in a cell Array
显示 更早的评论
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
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 个评论
Deon Hargrove
2020-3-4
KALYAN ACHARJYA
2020-3-4
Can you share the code screenshot and error message?
Deon Hargrove
2020-3-4
Stephen23
2020-3-4
Deon Hargrove
2020-3-4
类别
在 帮助中心 和 File Exchange 中查找有关 String 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!