Problem 38. Return a list sorted by number of occurrences
Solution Stats
Problem Comments
-
2 Comments
Good problem!
It is easy if you use matlab function...
useful function ==> categorical, countcats , sort, unique
solution:
https://github.com/AhmedNazir/MatlabCody/blob/master/popularity.m
Solution Comments
-
1 Comment
this type of hack solutions should be banned
-
1 Comment
The behavior of accumarray has changed. In R2012b, I used I = accumarray(I.', 1); and it worked. I had to remove the transpose to pass the test suite.
-
1 Comment
Interesting cody behavior by masking anonymous functions with str2num...
-
1 Comment
Test Suite having a hissy fit because it wanted a col not a row o_O
Problem Recent Solvers1884
Suggested Problems
-
Sum all integers from 1 to 2^n
11077 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
2252 Solvers
-
Convert a Cell Array into an Array
903 Solvers
-
Deleting an element in a matrix
407 Solvers
-
4815 Solvers
More from this Author95
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!