代码拉取完成,页面将自动刷新
同步操作将从 snowland.ltd/snowland-FCE 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
function TheResultMoHu = fce(a, d)
% a 为评价集标准值
% d 为待判样品值
%
% Program modification from http://www.pudn.com/Download/item/id/2798831.html
% code update on 2018-03-19
% A.Star, Snowland Co. Ltd, chenxiaolong12315@163.com
% Example:
% a=[0.9 0.9 0.9 0.9;
% 0.7 0.7 0.7 0.7;
% 0.5 0.5 0.5 0.5;
% 0.3 0.3 0.3 0.3;
% 0.1 0.1 0.1 0.1;
% ];
% d=[
% 0.92 0.9 0.86 0.88;
% 0.93 0.88 0.87 0.89;
% 0.67 0.68 0.78 0.79;
% 0.73 0.78 0.75 0.69;
% 0.58 0.52 0.57 0.43;
% 0.41 0.54 0.44 0.42;
% 0.31 0.27 0.22 0.4;
% 0.35 0.36 0.23 0.28;
% 0.16 0.18 0.19 0.18;
% 0.05 0.15 0.07 0.13;
% ];
% res = fce(a, d)
[m,n]=size(a);
[x,y]=size(d);
TheResultMoHu=[];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for s=1:x
for p=1:n
b(p)=d(s,p);
end
for i=1:n %计算每一个列的平均值
ColAverage(i)=0;
for j=1:m
ColAverage(i)=ColAverage(i)+a(j,i);
end
ColAverage(i)=ColAverage(i)/m;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ETotal = 0; %超标加权法计算权重
for j = 1: n
ETotal = ETotal + (b(j) / ColAverage(j));
end
for i = 1: n
EResult(i) = (b(i) / ColAverage(i)) / ETotal; %EResult为计算结果
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%使用隶属函数,做预处理对每一列进行排序
SortedMatrix=a;
for j=1:n
for i=1:m
for k=i:m
if SortedMatrix(i,j)>SortedMatrix(k,j)
tmp=SortedMatrix(i,j);
SortedMatrix(i,j)=SortedMatrix(k,j);
SortedMatrix(k,j)=tmp;
end
end
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%计算单因素隶属度
c=SortedMatrix;
for j = 1 : n
for i = 1 : m
k = 1;
if b(j) < c(k, j)
LSDResult(j, i) = 1;
end
if b(j) >= c(k, j) & b(j) < c(k + 1, j)
LSDResult(j, i) = ((c(k + 1, j) - b(j)) / (c(k + 1, j) - c(k, j)));
end
if b(j) >= c(k + 1, j)
LSDResult(j, i) = 0;
end
for k = 2 : m-1
if a(i, j) == c(k, j)
if k > 1 & k < m
if b(j) < c(k - 1, j)
LSDResult(j, i) = 0;
end
if b(j) >= c(k - 1, j) & b(j) < c(k, j)
LSDResult(j, i) = ((b(j) - c(k - 1, j)) / (c(k, j) - c(k - 1, j)));
end
if b(j) >= c(k, j) & b(j) < c(k + 1, j)
LSDResult(j, i) = ((c(k + 1, j) - b(j)) / (c(k + 1, j) - c(k, j)));
end
if b(j) >= c(k + 1, j)
LSDResult(j, i) = 0;
end
end
end
end
k = m;
if b(j) < c(k - 1, j)
LSDResult(j, i) = 0;
end
if b(j) >= c(k - 1, j) & b(j) < c(k, j)
LSDResult(j, i) = ((b(j) - c(k - 1, j)) / (c(k, j) - c(k - 1, j)));
end
if b(j) >= c(k, j)
LSDResult(j, i) = 1;
end
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%权重乘以单因素隶属度得到最终结果
R=LSDResult;
E=EResult;
E=[0.4236 0.227 0.1224 0.2771];
FuzzyEvalution=E*R;
TheResultMoHu=[TheResultMoHu;FuzzyEvalution];
end
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。