필터 지우기
필터 지우기

How sort rows of matrix as per given index

조회 수: 23 (최근 30일)
Vishal Sharma
Vishal Sharma 2017년 8월 10일
답변: KSSV 2017년 8월 10일
I have a matrix, A A = [1 2 3, 4 5 6, 7 8 9];
I want to sort rows of this matrix as per sequence of [2nd row; 3rd row; 1st row]
Thanks & Regards

채택된 답변

KSSV
KSSV 2017년 8월 10일
A = [1 2 3 ; 4 5 6 ; 7 8 9];
idx = [2 3 1] ;
A = A(idx,:)

추가 답변 (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