Octave command:
octave:14> a=[1,3,0;2,3,6;4,7,8]
a =
1 3 0
2 3 6
4 7 8
octave:15> shift(a,1)
ans =
4 7 8
1 3 0
2 3 6
Details: create a generic nxn matrix (I chose a 3x3 for illustration purposes) and use the 'shift' function in octave to have the matrix wrap around bottom -> top.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment