This preview shows page 1. Sign up to view the full content.
Unformatted text preview: %defines temporary var for pivot line ab(j,:) = ab(k,:); %renames another line to be the pivot line ab(k,:) = abTemp; %sets the temp line to position of moved line break end end end for i = j+1:R %subtracts lines times multiple of Pivot equation ab(i,j:C) = ab(i,j:C) - ab(i,j)/ab(j,j)*ab(j,j:C); end end %%Back Substitution x = zeros(R,1); x(R)=ab(R,C)/ab(R,R); %Calculates last element of x for i = R - 1:-1:1 %loop that runs backwards %substitutes values of x and [a'] and [b'] x(i) = (ab(i,C) - ab(i,i + 1:R)*x(i+1:R))/ab(i,i); end...
View Full Document
This note was uploaded on 04/01/2011 for the course ECM 006 taught by Professor Higgins during the Spring '07 term at UC Davis.
- Spring '07