if exists('A')==1 A irev=input('Type the number 1 to revise A '); else irev=1;end if irev==1 A=input('Type the new matrix A e.g.[1 2;3 4] '); end goon=1; while goon~=0 A v=input('1 to divide;2 for one type 3 row op (*row+);3 to revert;4 to swap rows;7 for more options: '); if v==7 v=input('5 to stop; 6 to see your matrix A in fractional form: '); end if v==3 atmp=A;A=aprev;aprev=atmp; else aprev=A; end if v==5, goon=0; end if v==6 [numerators denominators]=rat(A) end if v==1 r=input('Divide row '); x=input(' by the following number: '); A(r,:)=A(r,:)/x; end if v==4 r=input('Swap row '); x=input(' with row '); tmp=A(r,:);A(r,:)=A(x,:);A(x,:)=tmp; end if v==2 r=input('Replace row '); c=input(' with itself plus c * Row j, where c= '); j=input(' and j= '); A(r,:)=A(r,:)+c*A(j,:); end end v=input('6 to see result in fractional form; 5 to really stop: '); if v==6 [numerators denominators]=rat(A) end return