1、clcClearallx=[]; a=min(x); b=max(x); [n,m]=size(x); k=1/log(n); for i=1:n for j=1:m x(i,j)=(x(i,j)-a(j))/(b(j)-a(j))*100; %高优指标处理 End end for i=1:n for j=1:m x(i,j)=(b(j)-x(i,j))/(b(j)-a(j))*100; %低优指标处理 End end he=sum(x);for i=1:n for j=1:m
2、 p(i,j)=x(i,j)/he(j); end end %指标归一化 for i=1:n for j=1:m if p(i,j)==0 z(i,j)=0; else z(i,j)=log(p(i,j)); End End end e=zeros(1,m); for i=1:1n for j=1:m e(j)=e(j)+p(i,j)
3、*z(i,j)*(-k); End end he=sum(e); for i=1:m g(i)=1-e(i)/(m-he) end for i=1:m w(i)=g(i)/sum(g); %计算权重 end s=zeros(1,n); for i=1:n %计算综合得分 for j=1:m s(i)=s(i)+w(j)*p(i,j); End end