Permute the values of cells in the same matrix
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Cedrick De Block
el 16 de Jul. de 2021
Comentada: Cedrick De Block
el 16 de Jul. de 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 comentarios
Respuesta aceptada
KSSV
el 16 de Jul. de 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 ;
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrices and Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!