# Demo entry 6741528

t2

Submitted by anonymous on May 15, 2018 at 17:45
Language: Matlab. Code size: 1.7 kB.

```% 每个景点受聚类内的景区影响
pnew=zeros(60,1);
for i=1:9
index=find(tag==i);
pi=P(index);
lai=normal_la(index);
longi=narmal_long(index);
clustersize=length(index);
dij=zeros(clustersize,clustersize);
disij=zeros(clustersize,clustersize);
mmindistance=min(min(disij));
for j=1:clustersize
for k=1:clustersize
disij(j,k)=(((lai(j)-lai(k))^2+(longi(j)-longi(k))^2))^4;
if j~=k
dij(j,k)=(pi(j)^3*pi(k))/disij(j,k);
else
dij(j,k)=0;
end
end
end
dij=dij*mmindistance;
suminfluence=sum(dij,2).^(0.25);
for j=1:clustersize
pnew(index(j))=suminfluence(j)+P(index(j));
end
end
samNo=[1:60];
[sortP,IX]=sort(pnew,'descend');  % 关联度降序排序，IX确保对应的样本序号一致
sortSamNo=samNo(IX);           % 排序后与关联度对应的样本序号

namesort=names(sortSamNo)

figure;
subplot(2,1,1);
plot(pnew,'--rs',...
'LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',10);
xlim([1 60]);   % 设置x轴范围
xlabel('样本序号','FontSize',12,'FontWeight','bold');
set(gca,'xtick',1:60);
set(gca,'XTickLabel',samp,'FontWeight','light');
ylabel('关联度','FontSize',12,'FontWeight','bold');
title('南京市旅游景区热门程度灰色关联度综合评价结果');

grid on;

subplot(2,1,2);
plot(sortP,'--rs',...
'LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g',...
'MarkerSize',10);
xlim([1 60]);   % 设置x轴范围
xlabel('样本序号','FontSize',10,'FontWeight','bold');
set(gca,'xtick',1:60);
set(gca,'XTickLabel',sortSamNo,'FontWeight','light');
ylabel('关联度','FontSize',10,'FontWeight','bold');
title('南京市旅游景区热门程度灰色关联度综合评价结果');
grid on;
hold off;
```

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.