clear all
clc
clf
%%
n=18;
theta = linspace(0,2*pi,(n+1));
theta = theta(1:end-1);
[x,y] = pol2cart(theta,1);
links=triu(round(rand(length(theta))));%# this is a random list of connections
[ind1,ind2] = ind2sub(size(links),find(links(:)));
txt = cellstr(num2str((1:n)','%02d'));
% p_tm=symrcm(links);
% links_new=links(p_tm,p_tm);
% txt = txt(p_tm);
weig =rand(size(ind1));
col_mm = jet(length(ind1));
plot(x,y,'.k','markersize',20);
hold on
axis equal
arrayfun(@(p,q,r,colr,colg,colb)line([x(p),x(q)],[y(p),y(q)],...
'linewidth',1+2*r,'color',[colr colg colb]),ind1,ind2,weig...
,col_mm(:,1),col_mm(:,2),col_mm(:,3));
axis equal off
h = text(x.*1.1, y.*1.1, txt, 'FontSize',14);
for i=1:n
set(h(i), 'Rotation',theta(i)*180/pi-90);
end
colorbar