function z=isin(x,y,a,b)
%builds a matrix from of [x(:,1),y(:,1)]  for which x(:,2)==y(:,2) and is
%between a and b.  
z=[];
ni=1:(size(x,1));
ni=ni((x(:,2)>=a)&(x(:,2)<=b));
for i=ni
    v=y(x(i,2)==y(:,2),1);
    if (~isempty(v))
z=[z;[x(i,1),v,x(i,2)]];
end
end
