AAE-NA-Labs/Direct Methods for Solving Linear Systems/Alg7.m

13 lines
314 B
Mathematica
Raw Normal View History

function [L, U] = Alg7(A)
% ADDME LU Factorization without pivoting
% [L, U] = Alg7(A) decomposes matrix A into U upper triangular matrix and
% L lower unit triangular matrix such, that A = LU.
[m, n] = size(A);
A = Alg1_outer_product_gaussian_elimination(A);
U = triu(A);
L = tril(A, -1) + eye(m);
end