MATLAB: How sort rows of matrix as per given index sortsortrows I have a matrix, A A = [1 2 3, 4 5 6, 7 8 9]; I want to sort rows of this matrix as per sequence of [2nd row; 3rd row; 1st row] Thanks & Regards Best Answer A = [1 2 3 ; 4 5 6 ; 7 8 9]; idx = [2 3 1] ;A = A(idx,:) Related SolutionsMATLAB: Delete duplicated row in a matrix I = ~ismember(a(:,1:2),b(:,1:2),'rows'); a = a(I,:) MATLAB: Sorting Use the sortrows() function instead. Related QuestionMATLAB function for reordering the matrix rows and columns as desiredSortingDelete rows from matrix according to another matrix
Best Answer