模糊层次分析法FAHPmatlab代码

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

计算结果
w =
1.0000 0.2079 0.2613 w2 = 0.6806 0.1415 0.1779
编程
clc,clear a1=[0.33 0.33 0.34;0.28 0.33 0.40;0.28 0.33 0.39]; b1=sum(a1); a2=[0.29 0.32 0.4;0.33 0.33 0.34;0.21 0.33 0.47]; b2=sum(a2); a3=[0.28 0.32 0.39;0.21 0.32 0.47;0.33 0.33 0.34]; b3=sum(a3); d1=b1(1)+b2(1)+b3(1); d2=b1(2)+b2(2)+b3(2); d3=b1(3)+b2(3)+b3(3); s1=[b1(1) b1(2) b1(3)].*[1/d3 1/d2 1/d1]; s2=[b2(1) b2(2) b2(3)].*[1/d3 1/d2 1/d1]; s3=[b3(1) b3(2) b3(3)].*[1/d3 1/d2 1/d1]; s=[s1;s2;s3]; sl=s(:,1); sm=s(:,2); su=s(:,3); v1=[]; for i=1 for j=[2,3] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1;
V=[v1,v0]; v1=V; end end v2=[]; for i=2 for j=[1,3] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1; V=[v2,v0]; v2=V; end end v3=[]; for i=3 for j=[1,2] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1; V=[v3,v0]; v3=V; end end dc1=min(v1); dc2=min(v2); dc3=min(v3); w=[dc1,dc2,dc3]' for ii=1:3 w2(ii,1)=w(ii,1)/sum(w);%对w归一化并输出 end w2
计算结果
w =
1.0000 0.9851 0.9701 w3 = 0.3384 0.3333 0.3283
编程
clc,clear a1=[1 1 1;;0.95 1.25 1.59]; b1=sum(a1); a2=[;1 1 1;1.5 2 2.5]; b2=sum(a2); a3=[0.95 1.25 1.59;0.4 0.5 0.67;1 1 1]; b3=sum(a3); d1=b1(1)+b2(1)+b3(1); d2=b1(2)+b2(2)+b3(2); d3=b1(3)+b2(3)+b3(3); s1=[b1(1) b1(2) b1(3)].*[1/d3 1/d2 1/d1]; s2=[b2(1) b2(2) b2(3)].*[1/d3 1/d2 1/d1]; s3=[b3(1) b3(2) b3(3)].*[1/d3 1/d2 1/d1]; s=[s1;s2;s3]; sl=s(:,1); sm=s(:,2); su=s(:,3); v1=[]; for i=1 for j=[2,3] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1; V=[v1,v0];
编程
clc,clear a1=[1 1 1;0.86 1.17 1.56;0.67 1 1.5;0.33 0.39 0.49]; b1=sum(a1); a2=[0.64 0.85 1.16;1 1 1;2.5 3 3.5;0.95 1.33 1.83]; b2=sum(a2); a3=[0.87 1 1.49;0.29 0.33 0.40;1 1 1;0.4 0.5 0.67]; b3=sum(a3); a4=[2.04 2.56 3.03;0.55 0.75 1.05;1.49 2 2.5;1 1 1]; b4=sum(a4); d1=b1(1)+b2(1)+b3(1)+b4(1); d2=b1(2)+b2(2)+b3(2)+b4(2); d3=b1(3)+b2(3)+b3(3)+b4(3); s1=[b1(1) b1(2) b1(3)].*[1/d3 1/d2 1/d1]; s2=[b2(1) b2(2) b2(3)].*[1/d3 1/d2 1/d1]; s3=[b3(1) b3(2) b3(3)].*[1/d3 1/d2 1/d1]; s4=[b4(1) b4(2) b4(3)].*[1/d3 1/d2 1/d1]; s=[s1;s2;s3;s4]; sl=s(:,1); sm=s(:,2); su=s(:,3); v1=[]; for i=1 for j=[2,3,4] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1; V=[v1,v0]; v1=V; end end v2=[]; for i=2 for j=[1,3,4] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end
Hale Waihona Puke Baidu算结果
w = 0.3329 0.9743 0.0471 1.0000 w0 = 0.1414 0.4138 0.0200 0.4247
编程
clc,clear a1=[1 1 1;0.67 1 1.5;0.54 0.75 1.1]; b1=sum(a1); a2=[0.67 1 1.5;1 1 1;0.4 0.5 0.6]; b2=sum(a2); a3=[0.91 1.33 1.85;1.5 2 2.5;1 1 1]; b3=sum(a3); d1=b1(1)+b2(1)+b3(1); d2=b1(2)+b2(2)+b3(2); d3=b1(3)+b2(3)+b3(3); s1=[b1(1) b1(2) b1(3)].*[1/d3 1/d2 1/d1]; s2=[b2(1) b2(2) b2(3)].*[1/d3 1/d2 1/d1]; s3=[b3(1) b3(2) b3(3)].*[1/d3 1/d2 1/d1]; s=[s1;s2;s3]; sl=s(:,1); sm=s(:,2); su=s(:,3); v1=[]; for i=1 for j=[2,3] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1; V=[v1,v0];
计算结果
w = 0.5289
0.3861 1.0000 w1 = 0.2762 0.2016 0.5222
编程
clc,clear a1=[0.33 0.33 0.34;0.28 0.33 0.39;0.25 0.33 0.42]; b1=sum(a1); a2=[0.29 0.33 0.4;0.33 0.33 0.34;]; b2=sum(a2); a3=[0.24 0.32 0.43;;0.33 0.33 0.34]; b3=sum(a3); d1=b1(1)+b2(1)+b3(1); d2=b1(2)+b2(2)+b3(2); d3=b1(3)+b2(3)+b3(3); s1=[b1(1) b1(2) b1(3)].*[1/d3 1/d2 1/d1]; s2=[b2(1) b2(2) b2(3)].*[1/d3 1/d2 1/d1]; s3=[b3(1) b3(2) b3(3)].*[1/d3 1/d2 1/d1]; s=[s1;s2;s3]; sl=s(:,1); sm=s(:,2); su=s(:,3); v1=[]; for i=1 for j=[2,3] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1;
v1=V; end end v2=[]; for i=2 for j=[1,3] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1; V=[v2,v0]; v2=V; end end v3=[]; for i=3 for j=[1,2] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1; V=[v3,v0]; v3=V; end end dc1=min(v1); dc2=min(v2); dc3=min(v3); w=[dc1,dc2,dc3]' for ii=1:3 w1(ii,1)=w(ii,1)/sum(w);%对w归一化并输出 end w1
V=[v1,v0]; v1=V; end end v2=[]; for i=2 for j=[1,3] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1; V=[v2,v0]; v2=V; end end v3=[]; for i=3 for j=[1,2] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1; V=[v3,v0]; v3=V; end end dc1=min(v1); dc2=min(v2); dc3=min(v3); w=[dc1,dc2,dc3]' for ii=1:3 w3(ii,1)=w(ii,1)/sum(w);%对w归一化并输出 end w3
j=j+1; V=[v2,v0]; v2=V; end end v3=[]; for i=3 for j=[1,2,4] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1; V=[v3,v0]; v3=V; end end v4=[]; for i=4 for j=[1,2,3] if sm(i)>=sm(j) v0=1; elseif sm(i)<=sm(j)&su(i)>=sl(j) v0=(sl(j)-su(i))/((sm(i)-su(i))-(sm(j)-sl(j))); else v0=0; end j=j+1; V=[v4,v0]; v4=V; end end dc1=min(v1); dc2=min(v2); dc3=min(v3); dc4=min(v4); w=[dc1,dc2,dc3,dc4]' for ii=1:4 w0(ii,1)=w(ii,1)/sum(w);%对w归一化并输出 end w0
相关文档
最新文档