I have a matrix X which of size 100 by 100, I had sorted the rows of matrix X in the descending order so that the maximum in each row stays in the first column and store it in a new matrix Y.
[Y, indx] = sort(X,2,'descend');
I need to use the same sorting order used while sorting X in matrix P and store it in matrix Q. I had tried using the code,
This makes the sorting indices in the columns instead of rows. I need the sorting to be implemented in respective rows of P.
Thanks in advance!