//reduce the matrix to row echelon form clear; A=[2,-1,3,2;1,4,0,-1;2,6,-1,5] disp(A,"A:") disp("Applying row transformations") disp("R1=R1-2*R2"); A(1,:)=A(1,:)-2*A(2,:); disp(A,"A:") disp("R3=R3-2*R2"); A(3,:)=A(3,:)-2*A(2,:); disp(A,"A:") disp("R3=R3//(-2)"); A(3,:)=(-1/2)*A(3,:); disp(A,"A:") disp("R2=R2-4*R3"); A(2,:)=A(2,:)-4*A(3,:); disp(A,"A:") disp("R1=R1+9*R3"); A(1,:)=A(1,:)+9*A(3,:); disp(A,"A:") disp("R1=R1*2/15"); A(1,:)=A(1,:)*2/15; disp(A,"A:") disp("R2=R2+2*R1"); A(2,:)=A(2,:)+2*A(1,:); disp(A,"A:") disp("R3=R3-R1/2"); A(3,:)=A(3,:)-1/2*A(1,:); disp(A,"A:") x=A(1,:); A(1,:)=A(2,:) A(2,:)=x y=A(2,:) A(2,:)=A(3,:) A(3,:)=y disp(A,"A:");