Hi,
I would like to re-order a two-dimensional array in ascending order with respect to the first column, and in descending order with respect to the second column.
For instance, if my initial matrix is equal to A = [1 , 1; 2 , 1; 1 , 2; 2 , 2; 1 , 3; 2 , 3], I want the final matrix to be equal to A = [2 , 1; 2 , 2; 2 , 3; 1 , 1; 1 , 2; 1 , 3].
I would also need to keep track of the permutation of the row indices.
Best Answer