MATLAB: Removing repeated values from an array array manipulation Suppose I have an array [1.2 8 89 1.2 4 8 32 1.2]. Is there any MATLAB function that gives me the array without repeated values: [1.2 8 89 4 32]?! Best Answer Y=[1.2 8 89 1.2 4 8 32 1.2]unique(Y) % The result is sorted%orunique(Y,'stable') % the result is not sorted Related SolutionsMATLAB: How to reverse “sort” Hi,There is an extra optional argument that will do that:>> m=[1 6 2 8 9]; [Y,I] = sort(m,'descend')Y = 9 8 6 2 1I = 5 4 2 3 1>> MATLAB: Creating variable of specified length and same values a=1.2*(ones(4,1)) Related QuestionFind how many times same element is repeatedRegroup identical coordinate pairFind unique in matrix of x,y coordinatesSorting vector with duplicated values in it.A and B are coupled vectors. How to get from A->A_new B-> B_new
Best Answer