层次分析法matlab程序clca=[1,1/2,4,3,32,1,7,5,51/4,1/7,1,1/2,1/31/3,1/5,2,1,11/3,1/5,3,1,1];[x,y]=eig(a);eigenvalue=diag(y);lamda=eigenvalue(1);ci1=(lamda-5)/4;cr1=ci1/1.12w1=x(:,1)/sum(x(:,1))b1=[1 2 5;1/2 1 2;1/5 1/2 1];[x,y]=eig(b1);ei
来源:学生作业帮助网 编辑:作业帮 时间:2024/12/02 11:46:52
层次分析法matlab程序clca=[1,1/2,4,3,32,1,7,5,51/4,1/7,1,1/2,1/31/3,1/5,2,1,11/3,1/5,3,1,1];[x,y]=eig(a);eigenvalue=diag(y);lamda=eigenvalue(1);ci1=(lamda-5)/4;cr1=ci1/1.12w1=x(:,1)/sum(x(:,1))b1=[1 2 5;1/2 1 2;1/5 1/2 1];[x,y]=eig(b1);ei
层次分析法matlab程序
clc
a=[1,1/2,4,3,3
2,1,7,5,5
1/4,1/7,1,1/2,1/3
1/3,1/5,2,1,1
1/3,1/5,3,1,1];
[x,y]=eig(a);eigenvalue=diag(y);lamda=eigenvalue(1);
ci1=(lamda-5)/4;cr1=ci1/1.12
w1=x(:,1)/sum(x(:,1))
b1=[1 2 5;1/2 1 2;1/5 1/2 1];
[x,y]=eig(b1);eigenvalue=diag(y);lamda=eigenvalue(1);
ci21=(lamda-3)/2;cr21=ci21/0.58
w21=x(:,1)/sum(x(:,1))
b2=[1 1/3 1/8;3 1 1/3;8 3 1];
[x,y]=eig(b2);eigenvalue=diag(y);lamda=eigenvalue(1);
ci22=(lamda-3)/2;cr22=ci22/0.58
w22=x(:,1)/sum(x(:,1))
b3=[1 1 3;1 1 3;1/3 1/3 1];
[x,y]=eig(b3);eigenvalue=diag(y);lamda=eigenvalue(1);
ci23=(lamda-3)/2;cr23=ci23/0.58
w23=x(:,1)/sum(x(:,1))
b4=[1 3 4;1/3 1 1;1/4 1 1];
[x,y]=eig(b4);eigenvalue=diag(y);lamda=eigenvalue(1);
ci24=(lamda-3)/2;cr24=ci24/0.58
w24=x(:,1)/sum(x(:,1))
b5=[1 1 1/4;1 1 1/4;4 4 1];
[x,y]=eig(b5);eigenvalue=diag(y);lamda=eigenvalue(1);
ci25=(lamda-3)/2;cr25=ci25/0.58
w25=x(:,2)/sum(x(:,2))
w_sum=[w21,w22,w23,w24,w25]*w1
ci=[ci21,ci22,ci23,ci24,ci25];
cr=ci*w1/sum(0.58*w1)
运行结果是
cr1 =
0.0161
w1 =
0.2636
0.4758
0.0538
0.0981
0.1087
cr21 =
0.0048
w21 =
0.5954
0.2764
0.1283
cr22 =
0.0013
w22 =
0.0819
0.2363
0.6817
cr23 =
-2.5862
w23 =
3.0000
-1.5000
-0.5000
cr24 =
0.0079
w24 =
0.6337
0.1919
0.1744
cr25 =
-2.5862
w25 =
0.1667
0.1667
0.6667
w_sum =
0.4376
0.1415
0.4208
cr =
-0.4176
标准的结果是
权 准则层
值
决策层B1 B2 B3 B4 B5组合权向量
0.2636 0.4758 0.0538 0.0981 0.1087
0.5954 0.0819 0.429 0.6337 0.166
0.2764 0.2363 0.429 0.1919 0.166
0.1283 0.6817 0.142 0.1744 0.668
3.0055 3.0015 3 3.0092 3
0.00275 0.00075 0 0.0046 0
0.58 0.58 0.58 0.58 0.58
0.0047 0.0013 0 0.0079 0
哪里错了?帮我改!
层次分析法matlab程序clca=[1,1/2,4,3,32,1,7,5,51/4,1/7,1,1/2,1/31/3,1/5,2,1,11/3,1/5,3,1,1];[x,y]=eig(a);eigenvalue=diag(y);lamda=eigenvalue(1);ci1=(lamda-5)/4;cr1=ci1/1.12w1=x(:,1)/sum(x(:,1))b1=[1 2 5;1/2 1 2;1/5 1/2 1];[x,y]=eig(b1);ei
啊