function outmat = rowswap(inmat, row1, row2)
% function newmat = rowswap(inmat, row1, row2)
%
% Function mimics the rowSwap command on TI 83/84 series calculators,
% the purpose of which is to swap two rows in a given matrix, one of
% the elementary row operations of Gaussian elimination.
%
%  Inputs:     inmat  The matrix on which this row operation is to be performed
%         row1, row2  These are the row numbers which are to be exchanged
%  Output:    newmat  This is the matrix after the two rows are exchanged

 outmat = inmat;
 outmat(row2, :) = inmat(row1, :);
 outmat(row1, :) = inmat(row2, :);
end
