I have a matrix that I first determined the max value in each row and its row index. now I need to sort the whole matrix in descendant order based on the maximums identified from the row with the larget max to the row with smallest max. example: A=[0 1 2 1 1; 0 4 3 1 2; 1 2 0.5 3 5] ( matrix is 3*5. so first I need to identify the Max in each row and its index. so now it [2; 4; 5] then I need to reorder the matrix/ all the rows based on descendant order, so first row is the one with the highest max: SortedMatrix=[ 1 2 0.5 3 5;0 4 3 1 2;0 1 2 1 1]; any suggestions? please.
MATLAB: Sort a matrix based on a maximum value in each row
MATLABmatrixsort
Related Question
- Sorting array with condition (paths sorting)
- Creating a new matrix based on the data from other two matrices
- Sort in ascending order for first column then descending order for the second column.
- How can i create matrix for all possible combination
- Flipping the rows in a matrix to rearrange according to the weighted sum of the row
Best Answer