function y = flipud(x,mr)
%y = flipud(x,mr)
%flipud(x)		reverse the order of the argument rows
%flipud(x,mr)	reverse the order of the first mr rows

%       S.Halevy 7/31/92
%       Copyright (c) 1992 by the MathWizards

y=x;
[m,n] = size(y);
if nargin<2
   mr=m;
else
   mr = abs(mr);
end
mr=expr_sel(mr>m,m,mr);
y(mr:-1:1,:)=x(1:mr,:);
