fcm_calcu.asv
来自「FCM算法的matlab实现」· ASV 代码 · 共 43 行
ASV
43 行
function Umat = fcm_calcU(mfuz,Dmat);
% function Umat = fcm_calcU(mfuz,Dmat);
%
% Compute the partition matrix using matrix of distances
%
% mfuz = fuzzy parameter (> 1)
% Dmat = matrix of distances of size (K,M)
% Umat = fuzzy partition matrix of size (K,M)
%
% write by : DD
% date : 2001/05/07
% modif : 2001/06/27
[K,M] = size(Dmat);
for i=1:K
for k=1:M
if(Dmat(i,k)==0.0)
Umat(i,k)=1;
cardIr = 0;
for s=1:K
if (Dmat(s,r) == 0.0) cardIr = cardIr+1; end
end
if (cardIr == 0)
for s=1:K
nume = Dmat(s,r);
deno = (nume./Dmat(:,r)).^(1/(mfuz-1));
Umat(s,r) = 1.0/sum(deno);
end
else
for s=1:K
if (Dmat(s,r) == 0.0)
Umat(s,r) = 1.0/cardIr;
else
Umat(s,r)= 0.0;
end
end
end
end
return %% end of function fcm_calcU.m
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?