MATLAB: Change or remove duplicate matrix elements

duplicate valuesmatrices

I have the matrix:
value =
3.1727
5.2495
5.2708
3.3852
5.6222
5.2708
5.1444
4.9834
5.7499
5.7499
3.4728
3.4728
5.3560
5.7499
3.4728
5.7286
6.1225
3.6539
3.0351
4.3020
5.2296
3.8040
4.6747
5.4412
3.6539
and I want to add 0.1 to any duplicate entries, so that all values are unique, and none are removed.
I have tried:
value=sort(value)
for i=1:(length(value)-1)
if value(i+1)==value(i);
value(i+1)=(value(i+1)+0.1);
end
end
But for some reason it has no impact on the matrix..
Your help is greatly appreciated, thanks!
**EDIT: how can i remove all but the first occurance of a duplicate value? unique does not work for me.

Best Answer

X = [1 2 3 3 4 5 2]';
X2 = sort(X,1);
idx = [false;diff(X2)<(10^-6)]; %equal to 10^-6th precision
X2(idx) = X2(idx)+.1;