필터 지우기
필터 지우기

Permute the values of cells in the same matrix

조회 수: 5 (최근 30일)
Cedrick De Block
Cedrick De Block 2021년 7월 16일
댓글: Cedrick De Block 2021년 7월 16일
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