Problem 77. Clean the List of Names
Given a list of names in a cell array, remove any duplications that result from different capitalizations of the same string. So if
names_in = {'bert','arthur','Bert','Fred'};
the
names_out = clean_list(names_in)
results in
names_out = {'bert','arthur','Fred'};
Always take the first occurrence of the duplicated string
Solution Stats
Problem Comments
-
1 Comment
rifat
on 2 Jun 2014
I used lower() and unique().Runs fine on my R2010a version. shows error here.
Solution Comments
Show commentsProblem Recent Solvers1750
Suggested Problems
-
Return a list sorted by number of occurrences
2815 Solvers
-
Create a cell array out of a struct
2067 Solvers
-
Flip the main diagonal of a matrix
825 Solvers
-
Construct an index vector from two input vectors in vectorized fashion
396 Solvers
-
Permute diagonal and antidiagonal
456 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!