function modelmat=creatcontmodel th=linspace(-pi,pi,9); th=[th(1:8) th(1:8)]; for a=1:length(th) for b=1:length(th) modelmat(a,b)=(abs(angdiff(th(a),th(b)))/pi); %minor difference since we are using euclidean distance end end % figure;imagesc(modelmat) end