I need to write a program to take A and make the lower and upper triangular matrices for it.(adsbygoogle = window.adsbygoogle || []).push({});

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.

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Decomposing A into L and U (matrices)

**Physics Forums | Science Articles, Homework Help, Discussion**