How sort rows of matrix as per given index

23 次查看(过去 30 天)
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