Problem 532. Return unique values without sorting
Solution Stats
Problem Comments
-
3 Comments
perhaps you should specify that y is in the order of the first occurence of each unique element of x
This would be a better problem if unique and sort functions were not allowed
Nice problem!
Solution Comments
-
1 Comment
Solution without using sort(.) or unique(.) .
-
1 Comment
Solution without using sort(_) or unique(_) .
-
1 Comment
Note 1) this solution does not use sort() anywhere :) 2) the more elegant "stable" is not available for unique in pre-2012 MATLAB.
Problem Recent Solvers712
Suggested Problems
-
6509 Solvers
-
441 Solvers
-
Right Triangle Side Lengths (Inspired by Project Euler Problem 39)
1089 Solvers
-
Determine the number of odd integers in a vector
537 Solvers
-
4367 Solvers
More from this Author30
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!