clear; format compact; clf

c=0.4453; slope=23.2927; thresh=0.1793;

for retint=1:18;

    clear dtim;

    nitems = 11;
    nlists=1;

    for j=1:nitems*nlists; dtim(j)=(nitems*nlists-j); end
    dtim=dtim*15;

    dtim=dtim+retint+1;

    for n=1:nitems*nlists; dtim(n)=log(dtim(n)); end

    for n=1:nitems*nlists; dd(n)=0.0; end

    for n=1:nitems*nlists;
        for m=1:nitems*nlists;
            distance=abs(dtim(n)-dtim(m));
            dd(n) = dd(n) + exp(-c*distance);
        end
        serpos(n)=1/dd(n);
    end

    pcorr=1/(1+exp(-slope*(serpos(nitems*nlists)-thresh)));

    results(retint)=pcorr^3;
end

plot(results)
hold on