% Archana Gupta
% Project
% funtion to find unique index positions

function unineigh=uniqueneigh(neigh,frow)

neighno=size(neigh,1);

for i=1:neighno
    if neigh(i,1)>(frow*2)
        neigh(i,1)=neigh(i,1)-(frow*2);
    elseif neigh(i,1)>frow&&neigh(i,1)<=(frow*2)
        neigh(i,1)=neigh(i,1)-frow;
    else neigh(i,1)=neigh(i,1);
    end
end

unineigh=unique(neigh);
