I'm trying to write a code that can perform forward substitution for the equation Ax=b where A is a lower triangular matrix and x and b are column vectors.
I have the pseudo code figured out, but I can't make the script work!! I'm new to Matlab, but i'm trying to write a program that takes a lower triangular matrix and a column vector (the b vector) and performs the necessary forward substitution, then outputs then solution. Here's the blueprint:
for k = 1,...
[if g_jj = 0, set error flag (A is singular), exit
b_(k,1) = b_(k.1)*a_(k,k)
for m = k+1,...
[b_(m,1) = b_(m,1) - g(m,k)*b_(k,1)
can somebody help me figure out how to get this code in a format where It can be ran as a matlab script? Thank you!