how to swap this matrix
古いコメントを表示
i have this column of matrix
Z= 2
4
1
7
9
how to swap this 1 and 2
採用された回答
その他の回答 (1 件)
dpb
2013 年 10 月 17 日
Z(1:3)=flipud(Z(1:3));
Only works because of odd number, of course. In general to swap individual elements will still take the temporary to hold the one element while overwrite the other.
カテゴリ
ヘルプ センター および File Exchange で Matrices and Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!