Monday, May 26, 2008

Assignment #4, Q22

For this question we are asked to shift a matrix 'a' down, one place, and have values dropping off the bottom edge.

I took this as...'as we shift the entries down, the bottom row values go to zero and then are placed at the top of matrix 'a'.

Here are the octave commands. Again...for illustrative purposes I have used a generic 3x3 matrix to show (used for questions 19 and 20 also).

octave:22> a
a =

1 3 0
2 3 6
4 7 8

octave:23> c=[0,0,0;1,0,0;0,1,0]
c =

0 0 0
1 0 0
0 1 0

octave:24> c*a
ans =

0 0 0
1 3 0
2 3 6

No comments: