function out=r2(A,i,j) % % Anew=r2(A,i,j) % interchanges the i-th row and the j-th row of the matrix % Aold and assigns the new value to the matrix Anew. % % Note: Anew may be equal to Aold. In this case the old % matrix is overwritten. % % Author: M. Kawski, September 1996 % b=A(j,:); A(j,:)=A(i,:); A(i,:)=b; out=A;