I have a vector A=[2,5,6,2,4,13,34,3,34]. I want to find a unique value of this vector but not in sorted order! I searched in Matlab site and I found this function
A=[2,5,6,2,4,13,34,3,34]; [B, ia] = sort(A); % B = A(ia) ib(ia) = 1:length(B); % A = B(ib) [C, ic] = unique(B); % C = B(ic) D = B(ib(ic)); % unsorted unique values