%ELEMENTARY ROW OPERATIONS
%(Selcuk Bayin, METU-NCC, bayin@metu.edu.tr)
clc
A=[1 2 1 3;1 4 2 1;1 2 2 1;1 1 3 3]
b=[1;2;2;2]
%%
E=eye(4)
E(2,1)=-3
%Creates 4x4 elementary matrix
%%
E*A
%Subtracts 3 times Row1 of A from Row2
%Augmented matrix:
%%
B=[A,b]
%Reduced row echelon form:
%%
rref(B)
%%
%LU factoring for A
A
%%
[L,U,P]=lu(A);
%%
P
%%
L
%%
U
%Gives three matrices such that PA=LU
%%
PA=P*A
%%
PA=L*U