Ranking values - sorting into descending order
Mostrar comentarios más antiguos
I have a that for each row (i) ranks the column values. However, it ranks them in the ascending order. I require it to be ranked in descending order. Can anyone help with modifying the below code block to descending order?
for i = 1:height(d)
[temp, ranked] = ismember(X(i,:),unique(X(i,:)));
rnkR1List(i,:) = ranked;
end
Respuesta aceptada
Más respuestas (1)
Yazan
el 24 de Jul. de 2021
X = randn(10, 10);
Xranked = sort(X, 2, 'descend');
Categorías
Más información sobre Shifting and Sorting Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!