MATLAB: How to create this simple matrix

matrix

DNdog =
108
108
107
107
23
23
y = 108 %How do I get the above matrix to this state?
107
23

Best Answer

Using
unique