x1=[1 1 2 2 2 3 6 6 7 8];b=unique(x1);for ii = 1:length(b) a(ii) = sum(x1 == b(ii));enda = a(a~=1); %去掉a里面的“1”