- #1
physicsCU
- 202
- 1
I need to write a program to take A and make the lower and upper triangular matrices for it.
My idea is to use if statements, since what I am doing is setting U(i,j) equal to A(i,j) if i <= j and U(i,j) = 0 if i > j
For L(i,j), its equal to A(i,j) if i > j, 1 if i = j and 0 if i < j.
Any ideas how to do this? I am stumped on how to get the i and j parts working.
My idea is to use if statements, since what I am doing is setting U(i,j) equal to A(i,j) if i <= j and U(i,j) = 0 if i > j
For L(i,j), its equal to A(i,j) if i > j, 1 if i = j and 0 if i < j.
Any ideas how to do this? I am stumped on how to get the i and j parts working.