backsub - %M(:,4) = M(:,4) - M(:,i)*x(i); %M(:,i) = M(:,i)-...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
M=[9 2 5 1; 0 9.444444 -.0888889 2.2222222; 0 0 19 5]; x = [0 0 0]; for i=3:-1:1 % first, solve the ith equation for x(i) x(i) = (M(i,4)- (-1/2)*(i-3)*(i-2)*M(i,3)*x(2) - (i-3)*M(i,i+1)*x(3)) /M(i,i) % substitute x(i) into the matrix eqn. and move constant to 4th column
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %M(:,4) = M(:,4) - M(:,i)*x(i); %M(:,i) = M(:,i)- M(:,; %This step is unnecessary because i had previously pivoted the matrix as %shown above. end...
View Full Document

This note was uploaded on 06/23/2011 for the course ME 218 taught by Professor Unknown during the Fall '08 term at University of Texas.

Ask a homework question - tutors are online