Permute the values of cells in the same matrix
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Cedrick De Block
le 16 Juil 2021
Commenté : Cedrick De Block
le 16 Juil 2021
Hi guys,
I have a matrix of 66 X 2, but I want some cells to permute with other cells values.
For example the cell (row:59, column:2) has value = 23 and the cell (row:60, column:2) has value = 24,
I want those values to permute.
Can somebody help me?
Thank you in advance
0 commentaires
Réponse acceptée
KSSV
le 16 Juil 2021
Let A be your matrix.
[A(59,2),A(60,2)]=deal(A(60,2),A(59,2)) ;
or
t = A(59,2) ;
A(59,2) = A(60,2) ;
A(60,2) = t ;
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping 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!