function x=remi(x,y)

%REMI	Remainder after division for use with integer indices
%	remi(x,y) is x - n.*y where n=fix(x./y) and the elements of
%	x-n.*y equal to 0 are set to y

%       Etienne Balmes  08/25/94, 04/02/97
%       Copyright (c) 1990-2004 by SDTools,
%       All Rights Reserved.

y=y(1);
x = rem(x,y);
i1 = find(x==0); x(i1)=x(i1)+y;
