Problem 532. Return unique values without sorting
Solution Stats
Problem Comments
-
3 Comments
@bmtran (Bryant Tran)
on 27 Mar 2012
perhaps you should specify that y is in the order of the first occurence of each unique element of x
Peter Wittenberg
on 6 Oct 2012
This would be a better problem if unique and sort functions were not allowed
Jihye Sofia Seo
on 10 Feb 2017
Nice problem!
Solution Comments
-
1 Comment
yurenchu
on 7 Jun 2017
Solution without using sort(.) or unique(.) .
-
1 Comment
yurenchu
on 7 Jun 2017
Solution without using sort(_) or unique(_) .
-
1 Comment
Mark
on 1 Jun 2012
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
-
Select every other element of a vector
25875 Solvers
-
Find the alphabetic word product
2730 Solvers
-
The sum of the numbers in the vector
497 Solvers
-
5507 Solvers
-
Convert from Fahrenheit to Celsius
15230 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!