Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 3

Numerical Analysis and

Computation (LAB)
GS-401L

(LAB 3)
Lower Triangular Matrix
A matrix in which all the entries below the main diagonal are zero is known as Lower
Triangular Matrix.
MATLAB Program
function X=fwdsub(A,B)
clc
clear all
A=[1 0 0 0;2 3 0 0;10 8 6 0; 7 8 9 10];
B=[6;8;4;10];
n=length(B);
X=zeros(n,1);
X(1,1)=B(1)/A(1,1)
for j=2:n
X(j,1)=(B(j)-A(j,1:j-1)*X(1:j-1))/A(j,j);
end

You might also like