clear; format compact; clf

c=1.9176;

for interval=1:3;

    if interval==1; retint=10; end
    if interval==2; retint=15; end
    if interval==3; retint=20; end

    clear dtim;

    for trial = 1:5;

        nitems=trial;

        nlists=1;

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

        dtim=dtim*retint;

        if trial<=4; dtim=dtim+retint; end
        if trial==5; dtim=dtim+15; end

        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,trial)=pcorr^3;
    end

end

plot(results')
hold on
