Effacer les filtres
Effacer les filtres

MATLAB function for reordering the matrix rows and columns as desired

60 vues (au cours des 30 derniers jours)
N Madani SYED
N Madani SYED le 18 Jan 2012
Commenté : Sughosh le 13 Sep 2023
Hi all,
Suppose I have a nxn matrix ordered row-wise as well as column-wise as 1,2,3...10 (say n=10). Now if I wish to reorder the columns of this matrix as per the order [2 6 1 7 9 3 4 5 10 8], is there a MATLAB function readily available for the task?
Regards,
N. Madani SYED
  3 commentaires
Dyuman Joshi
Dyuman Joshi le 13 Sep 2023
@Sughosh What is the re-ordering that you want to do?
What you have tried that is not working?
Sughosh
Sughosh le 13 Sep 2023
no worries its working, its just that i did not assign a variable to them and was getting the same answer

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 18 Jan 2012
A(:,[2 6 1 7 9 3 4 5 10 8])
Easy ;-)
  2 commentaires
N Madani SYED
N Madani SYED le 18 Jan 2012
Thanks again.
Towhid
Towhid le 2 Mar 2020
So useful. Thanks a lot.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical 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