Count the number of times each unique element appears in a vector.
Example:
Input x = [2 9 1 2 4 9 2]
Output y = [1 1; 2 3; 4 1; 9 2]
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers23
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15819 Solvers
-
Create matrix of replicated elements
402 Solvers
-
674 Solvers
-
608 Solvers
-
270 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!