%折衷型模糊多属性决策方法
clc,clear
load mohu.txt
sj=[repmat(mohu(:,1),1,3),mohu(:,2:end)];
%首先进行归一化处理
n=size(sj,2)/3;m=size(sj,1);
w=[0.5*ones(1,3),0.125*ones(1,12)];
w=repmat(w,m,1);
y=[];
for i=1:n
tm=sj(:,3*i-2:3*i);
max_t=max(tm);
max_t=repmat(max_t,m,1);
max_t=max_t(:,3:-1:1);
yt=tm./max_t;yt(:,3)=min([yt(:,3)';ones(1,m)]);
y=[y,yt];
end
%下面求模糊决策矩阵
r=[];
for i=1:n
tm1=y(:,3*i-2:3*i);tm2=w(:,3*i-2:3*i);
r=[r,tm1.*tm2];
end
%求M+、M-和距离
mplus=max(r);mminus=min(r);
dplus=dist(mplus,r');dminus=dist(mminus,r');
%求隶属度
mu=dminus./(dplus+dminus);
[mu_sort,ind]=sort(mu,'descend')
mohu.txt
290 85 90 100 85 90 100 75 80 85 75 80 85
288 85 90 100 75 80 85 85 90 100 60 70 75
288 75 80 85 85 90 100 50 55 60 60 70 75
285 85 90 100 75 80 85 75 80 85 75 80 85
283 75 80 85 85 90 100 75 80 85 60 70 75
283 75 80 85 50 55 60 85 90 100 75 80 85
280 85 90 100 75 80 85 60 70 75 75 80 85
280 75 80 85 85 90 100 85 90 100 60 70 75
280 75 80 85 75 80 85 85 90 100 75 80 85
280 50 55 60 75 80 85 85 90 100 60 70 75
278 50 55 60 60 70 75 75 80 85 85 90 100
277 85 90 100 75 80 85 60 70 75 85 90 100
275 75 80 85 60 70 75 50 55 60 85 90 100
275 50 55 60 75 80 85 85 90 100 75 80 85
274 85 90 100 75 80 85 60 70 75 75 80 85
273 75 80 85 85 90 100 75 80 85 60 70 75
运行结果:
mu_sort =
Columns 1 through 11
0.8359 0.7731 0.7280 0.7278 0.6855 0.6768 0.6426 0.6421 0.6089 0.5987 0.5584
Columns 12 through 16
0.5420 0.5223 0.5104 0.4619 0.4491
ind =
1 4 9 2 8 5 12 7 16 15 6 3 14 10 11 13