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

1 visualización (últimos 30 días)
Kalpha.mc
Kalpha.mc el 20 de Sept. de 2020
Respondida: David Hill el 20 de Sept. de 2020
How would i sort a 15 x 5 matrix descending based on the 5th column without changing the first column.

Respuesta aceptada

David Hill
David Hill el 20 de Sept. de 2020
b=[a(:,1),sortrows(a(:,2:end),4,'descend')];

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by