Given the following matrix:
>> A = [3 3 0; 4 4 5; 0 0 1]
A =
3 3 0
4 4 5
0 0 1
The rotation matrix would look something like this:
>> G = [3/5 4/5 0; -4/5 3/5 0; 0 0 1]
G =
0.6000 0.8000 0
-0.8000 0.6000 0
0 0 1.0000
When applying Givens rotation to transform A into an upper triangular matrix (A = G*A), it will make A(2,1) null, however it will makes A(2,2) null as well, which is bad when trying to solve Ax = b with the Upper Triangular System algorithm, because of the 0 division.
Imagine the matrix in question something like 1000x1000. How would you curve around this problem?
Yes, this is homework, however this is by far not my task. It's also for my general knowledge and interest. Nevertheless, I am not allowed to use any Matlab implemented functions.
The reason you have a problem here is that A is singular. If A is well-conditioned (i.e. not "close" to a singular matrix), you won't run into this problem.