function Z=hecheng(X,X)
[m,m]=size(X);z=zeros(m,m);p4=zeros(1,m);
for i=1:m
for j=1:m
for k=1:m
p4(1,k)=min(X(i,k),Y(k,j));
end
Z(i,j)=max(p4);
end
end
应该能用!
function [U,center,result,w,obj_fcn]= fenlei(data)
[data_n,in_n] = size(data);
m= 2; % Exponent for U
max_iter = 100; % Max iteration
min_impro =1e-5; % Min improvement
c=3;
[center, U, obj_fcn] = fcm(data, c);
for i=1:max_iter
if F(U)>098
break;
else
w_new=eye(in_n,in_n);
center1=sum(center)/c;
a=center1(1)/center1;
deta=center-center1(ones(c,1),:);
w=sqrt(sum(deta^2))a;
for j=1:in_n
w_new(j,j)=w(j);
end
data1=dataw_new;
[center, U, obj_fcn] = fcm(data1, c);
center=center/w(ones(c,1),:);
obj_fcn=obj_fcn/sum(w^2);
end
end
display(i);
result=zeros(1,data_n);U_=max(U);
for i=1:data_n
for j=1:c
if U(j,i)==U_(i)
result(i)=j;continue;
end
end
end
result = resultreplaceAll(">\\s<", "><")replaceAll("<\\([^>|^\\])\\>", "");
String json = result;
Matcher matcher = Patterncompile("<([^>|^/])>")matcher(result);
while(matcherfind()){
for (int i = 0; i < matchergroupCount(); i++) {
String s = matchergroup(i+1);
json = jsonreplaceAll("<"+s+">([^<|^\"])</"+s+">", "\""+s+"\":\"$1\",");
}
}
除了模糊C值聚类,其他的聚类方法如:传递闭包法,直接聚类法都不用事先确定分类数,不过这些方法matlab上没有现成的函数,需要自己编程,10来行代码就解决了,不要偷懒哦!只有C值聚类有现成的函数fcm
以上就是关于MATLAB基于模糊聚类分析方法全部的内容,包括:MATLAB基于模糊聚类分析方法、求:FCM,PCM聚类算法MATLAB程序、MATLAB数据分析方法 主成份-聚类分析 matlab等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)