format compact
clear; clf

c=1.5239; thresh = 0.2773; slope=6.3485;

for cond=1:22;
    clear d;
    nitems = cond;
    for j=1:nitems; d(j)=(nitems-j); end
    d=d+24*60;
    d=d*60;

    for n=1:nitems; d(n)=log(d(n)); end

    for itemnum=1:nitems
        dd=0;
        for m=1:nitems
            dd = dd+ (exp(-c*(abs(d(itemnum)-d(m)))));
        end
        for n=1:nitems+0
            prob(n,itemnum)=(exp( -c*(abs(d(itemnum)-d(n)))))/(dd);
        end
    end

    for k=1:nitems+0; for j=1:nitems;
            prob(k,j)=1/(1+exp(-slope*(prob(k,j)-thresh)));
        end; end
    for n=1:nitems; serpos(n)=prob(n,n); end
    results(cond)=serpos(nitems);

end

plot(results)

