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

조회 수: 1 (최근 30일)
Kalpha.mc
Kalpha.mc 2020년 9월 20일
답변: David Hill 2020년 9월 20일
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에서 Matrices and Arrays에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by