I have this vector something like this
1
2
2
2
3
3
3
3
.
.
.
What I want to know is in how many rows the individual numbers appeared something like this
1 1
2 3
3 4
. .
. .
I can loop through each element and use
index = find(vector == element)
length(index)
But that is very inefficient. What is the most efficient way to do it in matlab?