フィルターのクリア

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 ;
  1 件のコメント
Cedrick De Block
Cedrick De Block 2021 年 7 月 16 日
Thank you, it works

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by