Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
function x = UpperTriangularSolve(A,b,n) % function x = UpperTriangularSolve(A,b,n) % % Solve the system A x = b where A is assumed to be upper triangular, % i.e. A(i,j) = 0 for j < i, and the diagonal is assumed to be nonzero, % i.e. A(i,i) \= 0. % % ARGUMENTS: A upper triangular n x n matrix % b right hand side column n-vector % n integer matrix dimension % % RETURNS: x column n-vector solution x = zeros(n,1); x(n) = b(n)/A(n,n); for i = n-1:-1:1 x(i) = ( b(i) - A(i,i+1:n)*x(i+1:n) ) / A(i,i); end
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.