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 Solvers718
Suggested Problems
-
Return a list sorted by number of occurrences
1890 Solvers
-
Project Euler: Problem 5, Smallest multiple
872 Solvers
-
332 Solvers
-
Get the elements of diagonal and antidiagonal for any m-by-n matrix
367 Solvers
-
Deleting an element in a matrix
412 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!