A=[1 -2 3 -4 2; -2 4 -1 -7 6; 1 -2 4 -5 4; -3 6 -6 3 0]
A(2,3) % (2,3)-entry of A
A(3,4)=-7 % correcting (3,3)-entry of A
A % new A
Asub1=A(2:3,1:3)
Asub2=A(2:3,:)
Asub2(:,2)=[]
ones(2,3)
A1=eye(3)
u=[5 6 7]
A2=[A1;u] % adding a row
A3=[A1 u'] %adding a column
Astar=rref(A) %Astar is the reduced raw echelon form of A
b=[1 2 3 4]' % Transpose
Aaug=[A b] % augmented matrix
% Solve Ax=b
Aaugstar=rref(Aaug)
% New example
B=[2 -3 0; 4 -5 1; 2 0 4]
[L,U,P]=lu(B)% LU factorization with pivoting
c=[8;15;1]    
Baug=[B c] % augmented matrix of the system Bx=c
Buagstar=rref(Baug)
Buagstar(:, 4) % Solution (extract the fourth column of the rref of Baug)
x=B\c % Solve for x
d=B*x % Checking the solution
inv(B) % inverse of B
inv(B)*c
det(B)
D=rand(2,3) % random matrix
