Effacer les filtres
Effacer les filtres

How sort rows of matrix as per given index

23 vues (au cours des 30 derniers jours)
Vishal Sharma
Vishal Sharma le 10 Août 2017
Réponse apportée : KSSV le 10 Août 2017
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

Réponse acceptée

KSSV
KSSV le 10 Août 2017
A = [1 2 3 ; 4 5 6 ; 7 8 9];
idx = [2 3 1] ;
A = A(idx,:)

Plus de réponses (0)

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by