How can i sort all the rows of a matrix but one along a row

1 vue (au cours des 30 derniers jours)
Kalpha.mc
Kalpha.mc le 20 Sep 2020
How would i sort a 15 x 5 matrix descending based on the 5th column without changing the first column.

Réponse acceptée

David Hill
David Hill le 20 Sep 2020
b=[a(:,1),sortrows(a(:,2:end),4,'descend')];

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by