Question: Adjusting a do loop for matrix algebra? ----- I am trying to write a program in Maple to create a lower-triangular matrix. My professor provided
Adjusting a do loop for matrix algebra?
-----
I am trying to write a program in Maple to create a lower-triangular matrix. My professor provided a do loop in class that creates an upper-triangular matrix, but I don't even understand how that works, so I can't change the code to make it create a lower-triangular matrix instead.
Given the matrix A:

I can use the code:
for j to 4 do
for i to 4 do
if i > j then
c := -A[i, j]/A[j, j];
for k to 4 do
A[i, k] := c*A[j, k]+A[i, k]
end do
end if
end do
end do;
... which results in the matrix,

How can I adjust this code to make it do lower-triangular instead? I don't even understand the upper-triangular code. I understand Gaussian elimination, but I don't understand how this code works because of the nested loops.
3 1 0 10 21 1021 421 12 12
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
