Azzera filtri
Azzera filtri

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

2 visualizzazioni (ultimi 30 giorni)
How would i sort a 15 x 5 matrix descending based on the 5th column without changing the first column.

Risposta accettata

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

Più risposte (0)

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by