MATLAB: How to print duplicate (repeated) value from an array

duplicaterepeating value

Dear experts,
I have to print the duplicate (repeated) value from the following array. Please help me.
104.96
81.01
-35.21
-150.76
145.22
104.96
20.62
-90.79

Best Answer

More simpler way:
[C,~,~]=unique(v);
val=sum(v)-sum(C)
Edit after Image Analyst's warning:(works for any situation)
[C,~,idx]=unique(v,'stable');
n=accumarray(idx(:),1);
vals=C(find(n~=1))