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일

0 개 추천

[~,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개)

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

태그

질문:

FIR
2012년 2월 18일

편집:

2013년 10월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by