Sorting matrix

조회 수: 4 (최근 30일)
FIR
FIR 2012년 2월 18일
편집: Cedric 2013년 10월 15일
I have amatrix
A=[1 2 13;
10 1 2;
8 14 3]
I want to sort 2nd column,so the corresponding values must also change
as
A=[10 1 2;
1 2 13;
8 14 3]

채택된 답변

Wayne King
Wayne King 2012년 2월 18일
[~,indices] = sort(A(:,2));
A = A(indices,:);
  댓글 수: 1
FIR
FIR 2012년 2월 18일
Thanks Wayne can u answer the question in plz
http://www.mathworks.in/matlabcentral/answers/29490-error-using-cell2mat

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by