Sounds like homework. As hints, I'd probably use max() to find the greatest integer and the histogram edges, histc() to get the counts, and ismember() to help with removal. It's just a few lines of code - see if you can do it.
You can also SORT the values at first and obtain the sorting index as 2nd output. Then use DIFF to find equal elements. Finally you can remove them and restore the original order by using the sorting index.