필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Sort the matrix corresponding to row

조회 수: 1 (최근 30일)
Bathrinath
Bathrinath 2012년 2월 22일
마감: MATLAB Answer Bot 2021년 8월 20일
Hi,
I am new to matlab,can any one help me for sorting the matrix
AA =[2,3,4,5,1,6;21,22,30,36,39,40]
In the matrix AA I want to sort with respect to second row in descending order,so that I can get
AA=[6,1,5,4,3,2;40,39,36,30,22,21]

답변 (1개)

Sean de Wolski
Sean de Wolski 2012년 2월 22일
sortrows(AA,-2);
and
doc sortrows %for more info

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by