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 Solvers722
Suggested Problems
-
Given a window, how many subsets of a vector sum positive
818 Solvers
-
444 Solvers
-
Output any real number that is neither positive nor negative
346 Solvers
-
Sum the numbers on the main diagonal
513 Solvers
-
Integer Sequence - II : New Fibonacci
396 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!