精选优质文档-倾情为你奉上层次分析法matlab源程序disp(请输入判断矩阵A(n阶);A=input(A=);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 kp 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);enda=sum(y(:,i);w=y(:,i)/a;t=m(i);disp(w);disp(t); %以下是一致性检验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