1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| x=[6 5 9 2 ;8 8 6 5;8 7 8 5;7 6 7 5] (1)数据正向性处理 zu=[0 0 0 1] [m,n]=size(x); R=x; for i=1:m for j=1:n
if zu(j)==1 R(i,j)=(x(i,j)-max(x(:,j)))/(min(x(:,j))-max(x(:,j))); end end end R (2)由层次分析法计算属性权重 A=[6 5 9 2 ;8 8 6 5;8 7 8 5;7 6 7 5] [n,n]=size(A); x=ones(n,100); y=ones(n,100); m=zeros(1,100); m(1)=max(x(:,1)); y(:,1)=x(:,1); x(:,2)=A*y(:,1); m(2)=max(x(:,2)); y(:,2)=x(:,2)/m(2); p=0.0001;i=2;k=abs(m(2)-m(1)); while k>p i=i+1; x(:,i)=A*y(:,i-1); m(i)=max(x(:,i)); y(:,i)=x(:,i)/m(i); k=abs(m(i)-m(i-1)); end a=sum(y(:,i)); w=y(:,i)/a; t=m(i); disp(w); CI=(t-n)/(n-1);RI=[0 0 0.52 0.89 1.12 1.26 1.36 1.41 1.46 1.49 1.52 1.54 1.56 1.58 1.59]; CR=CI/RI(n); if CR<0.10 disp('此矩阵的一致性可以接受!'); disp('CI=');disp(CI); disp('CR=');disp(CR); end (3)采用主因素突出型进行模糊综合评价 w=w' fuzzy_zhpj(2,R,w)
|