5、.751055.501379.00875.101.65];%待判数据[rows,cols]=size(fangzhen);p=0.5; %分辨系数[m,n]=size(yangben); R=[];forirow=1:rows yy=fangzhen(irow,:); data=[yy;yangben]; data_gyh1=mean(yangben) fori=1:m+1 forj=1:n data_gyh(i,j)=data(i,j)/data_gyh1(j); end end
6、 fori=2:m+1 forj=1:n Dij(i-1,j)=abs(data_gyh(1,j)-data_gyh(i,j)); end end Dijmax=max(max(Dij)); Dijmin=min(min(Dij)); fori=1:m forj=1:n Lij(i,j)=(Dijmin+p*Dijmax)/(Dij(i,j)+p*Dijmax); end end LijRowSum=sum(Lij');
7、 fori=1:m Rij(i)=LijRowSum(i)/n; end R=[R;Rij];endRmatlab求灰色关联度矩阵源代码2010-12-1122:57functiongreyrelationaldegree(X,c)%GRAYRELATIONALDEGREEthisfunctionisusedforcalculatingthegery%relationbetweensquence%rememeberthatth