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

1 次查看(过去 30 天)
How would i sort a 15 x 5 matrix descending based on the 5th column without changing the first column.

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Shifting and Sorting Matrices 的更多信息

标签

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by