The following is an example of what you will see in octave if you enter the 'octave' commands. These commands show you how to shift entries of a matrix 'a' on place left (wrapping around left -> right).
octave:16> a=[1,3,0;2,3,6;4,7,8]
a =
1 3 0
2 3 6
4 7 8
octave:17> b=[0,0,1;1,0,0;0,1,0]
b =
0 0 1
1 0 0
0 1 0
octave:18> a*b
ans =
3 0 1
3 6 2
7 8 4
Subscribe to:
Post Comments (Atom)
1 comment:
I did this in class for a generic 3x3 matrix. I wanted you to do it for a bigger matrix. Hmmm. I should have made it more clear by specifiying the size or saying it should work for any size. I put a problem on assignment 6 so that you can do this one again.
Post a Comment