Similar to unique, how can i use for case insenisitive

16 次查看(过去 30 天)
For example I have cell array a = { 'abc' , 'aBc' , 'xyz' , 'Xyz'}
now i need to remove the duplication.
As unique is the case sensitive, it returns the whole array.
how can i do it?
Thank you

采纳的回答

Jan
Jan 2015-6-25
编辑:Jan 2015-6-25
a = { 'abc' , 'aBc' , 'xyz' , 'Xyz'};
[dummy, ia] = unique(lower(a));
result = a(ia);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numbers and Precision 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by