function a=inside(x,y);
x=x(:);
if nargin==2
   y=y(:);
end
[xlim,ylim]=grect(7);
if xlim(1)>xlim(3)
    xlim(1)=xlim(3);
    xlim(3)=xlim(5);
end
if ylim(1)>ylim(3)
    ylim(1)=ylim(3);
    ylim(3)=ylim(5);
end
if nargin==2
a=find( (x>xlim(1))&(x<xlim(3))&(y>ylim(1))&(y<ylim(3)) );
hold on
plot(x(a),y(a),'xc5')
hold off
else
a=find((x>xlim(1))&(x<xlim(3)));
end

