ywh19860616 发表于 2012-5-10 23:18
epoh老师,就是distance_wm函数的返回结果的results.W
% results.dista = (n x n) matrix of ...
可以 Wij=normw(result.dw)
也可以 Wij=full(result.W)
Wij =
0 1.0000 0 0 0 0 0 0
0.3333 0 0.3333 0 0 0 0.3333 0
0 0.5000 0 0.5000 0 0 0 0
0 0 0.5000 0 0.5000 0 0 0
0 0 0 0.5000 0 0 0.5000 0
0 0 0 0 0 0 0 1.0000
0 0.3333 0 0 0.3333 0 0 0.3333
0 0 0 0 0 0.5000 0.5000 0
ZZmat的每行都分别找出一个最大值及其对应位置
ZZmat =
10.5321 13.1748 14.1048 14.1081 13.5731 12.7366 11.7508 10.7131 9.6844
7.0585 8.2455 8.2969 7.8566 7.2101 6.5026 5.8074 5.2754 4.7729
14.8975 18.3559 19.4375 19.3021 18.4963 17.3349 16.0100 14.6396 13.2945
16.2223 19.8581 20.8892 20.6055 19.6146 18.2636 16.7615 15.2342 13.7550
13.6478 16.6916 17.5135 17.2049 16.2868 15.0609 13.7105 12.3468 11.0344
13.8836 16.9895 17.8799 17.6583 16.8396 15.7157 14.4612 13.1810 11.9363
7.5528 8.9430 9.1190 8.7473 8.1289 7.4203 6.7042 6.0220 5.3923
10.1812 13.0251 14.2785 14.6337 14.4292 13.8759 13.1149 12.2428 11.3248
Indexmat=zeros(n1,3)
for i =1:n1
Indexmat(i,1)=i;
index=find(ZZmat(i,:)==max(ZZmat(i,:)));
Indexmat(i,2)=ZZmat(i,index);
Indexmat(i,3)=index;
end
Indexmat
Indexmat =
1.0000 14.1081 4.0000
2.0000 8.2969 3.0000
3.0000 19.4375 3.0000
4.0000 20.8892 3.0000
5.0000 17.5135 3.0000
6.0000 17.8799 3.0000
7.0000 9.1190 3.0000
8.0000 14.6337 4.0000


雷达卡
京公网安备 11010802022788号







