Matlab program to test LU_factor.m

% Script to test LU_factor.m for
% LU factorization of an n by n matrix A
% using Gauss elimination without pivoting
% LU_factort.m
% A is factored as A = L*U
% Output:
% L is lower triangular with the main diagonal part = 1s.
% U is upper triangular and is stored in the original mtx A
% K. Ming Leung, 01/26/03

clear all;
A=[1 2 2
4 4 2
4 6 4];
[n,n]=size(A);
[L,U]=LU_factor(A,n);
display(L);
display(U);
display(L*U);        % Must be the same as A