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
-
Create matrix of replicated elements
344 Solvers
-
Find the index of the largest value in any vector X=[4,3,4,5,9,12,0,4.....5]
335 Solvers
-
304 Solvers
-
455 Solvers
-
String Array Basics, Part 1: Convert Cell Array to String Array; No Missing Values
832 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!