Hi all, I'm writing a program to solve a system of linear algebraic equations using the method of Gaussian elimination. The only thing I can't figure out is how to perform the actual pivot.
In the %Forward elimination nest, I can't figure out how I am supposed to find the max_row. Is it just any row that has the maximum value or is it specific to the pivot row? Most of the function is translated from pseudo code posted by my professor and the only part I can't translate is how to get the max_row. Any help would be greatly appreciated!
%Solves a given system of linear equations Ax=b using the Gauss Elimination
%method. Equations in format Ax=b.
A=input('Enter the coefficient matrix: ');
b=input('Enter the right hand side vector b: ');
error('Coefficient matrix A must be square')
for p=1:n-1 %p is current pivot row
for i=p+1:n %operate on all rows below pivot
factor = Ab(i,p)/Ab(p,p);