📄 ahpvector.m
字号:
function [r,c]=ahpvector(x)
%AHPVECTOR Calculate the AHP ranking or weighting vector from an ...
% AHP reciproal matrix.
%
% R = AHPVECTOR(X) is the ordered AHP ranking based on the AHP matrix X.
%
% [R,C] = AHPVECTOR(X) returns the ordered AHP ranking R
% and the consistency ratio C.
% Note that C < 0.1 is considered heuristically acceptable.
sztemp=size(x);
n=sztemp(1);
[v,d]=eig(x);
i=1;
while d(i,i)<n-0.00001
i=i+1;
end
myeig=d(i,i);
myvec=v(:,i);
r=myvec/sum(myvec);
ci=(myeig-n)/(n-1);
randomci=[1 1 0.52 0.89 1.11 1.25 1.35 1.4 1.45 1.49 1.51];
if n>11
rci=1.5;
else
rci=randomci(n);
end
c=ci/rci;
if c > 0.1
s=sprintf('Warning: Consistency ratio %.3f > 0.1',c);
disp([s]);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -