Permute the values of cells in the same matrix

5 次查看(过去 30 天)
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

采纳的回答

KSSV
KSSV 2021-7-16
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 ;

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by