MATLAB: Find the repetition of matrix rows MATLABmatrices I want to find out if the row i of mxn matrix is repeated ,the code should give logic 1.Otherwise zero"there are many ways but Im searching for the best one" Thanks Best Answer Using the algorithm that Jan Simon posted in this Answer.% Example of dataX = [6 5 4; 1 2 3; 1 2 3; 1 2 4; 1 2 3];[~,~,A] = unique(X,'rows','stable');[n, bin] = histc(A, unique(A));multiple = find(n > 1);indexToDuplicate = ismember(bin, multiple); Related SolutionsMATLAB: Matrix repetition out = repmat(M,1,k); MATLAB: Fprintf repetition Answer: Don't Do That.fprintf() the absolute value sign in one operation, and then fprintf() the numbers in a second operation.Or, repeat the ' %3d' part in the format as many times as you have numbers to print. Such asfprintf('| %3d %3d %3d %3d %3d\n', T)if you were printing out 5 numbers across. Related QuestionFind the repetition of matrix rowsFinding repetition numbers in array.Dispositions with repetitions; dispositions without repetitions; combinations with repetitions.Matrix repetition on diagonalRandom numbers without repetition
Best Answer