Filter löschen
Filter löschen

Permute the values of cells in the same matrix

5 Ansichten (letzte 30 Tage)
Cedrick De Block
Cedrick De Block am 16 Jul. 2021
Kommentiert: Cedrick De Block am 16 Jul. 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

Akzeptierte Antwort

KSSV
KSSV am 16 Jul. 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 ;

Weitere Antworten (0)

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by