clear; format compact; clf
c=1.25;

for nitems = 1:3;

    for interval=1:3;
        if interval==1; retint=3; end
        if interval==2; retint=9; end
        if interval==3; retint=18; end

        clear dtim;

        nlists=1;

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

        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=serpos(nitems*nlists);
        results(interval,nitems)=pcorr^3;

    end

end

plot(results)
hold on

