中心を軸とした配列の入れ替え
Show older comments
以下のような5×5の奇数列の配列Aを中心である3列目をそのままに
配列Bのように左右に入れ替えたいです。
しかしB=circshift(A,[0 5/2]); とすると
エラー: circshift
無効なシフト タイプ: 有限の実数の整数ベクトルでなければなりません。
と出てしまいます。fliperやfftshiftなどのコマンドをそのまま使ってもできなかったので
この場合どのように構文すべきか教えていただけないでしょうか?
A =
17 24 1 8 15
23 5 7 14 16
4 6 13 20 22
10 12 19 21 3
11 18 25 2 9
B=
8 15 1 17 24
14 16 7 23 5
20 22 13 4 6
21 3 19 10 12
2 9 25 11 18
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!