function [NNeighPerf] = RecallTest(iXMinDistADC,nRecall,iMinDistExh) addpath('../Product Quantization/Functions'); addpath('../Product Quantization/Functions/Yael Library'); Ntests=size(iXMinDistADC,1); recAtR=([1 2 5 10 20 50 100 200 500 1000 2000 5000 10000]<=nRecall); reqRecall=zeros(Ntests,1); for ii = 1:Ntests iXeq=find(iXMinDistADC(ii,:)==iMinDistExh(1,ii)); if numel(iXeq)==1 reqRecall(ii)=iXeq; else reqRecall(ii)=nRecall+1; end end reqRecall=sort(reqRecall); ll=1; recAtR=[1 2 5 10 20 50 100 200 500 1000 2000 5000 10000]; recAtR=recAtR(recAtR<=nRecall); NNeighPerf=zeros(1,length(recAtR)); for ii=recAtR if ii <= nRecall NNeighPerf(ll) = length (find (reqRecall <= ii & reqRecall <= nRecall)) / Ntests; ll=ll+1; end end