;Р% class_num=3;Р% sample=dataset.sample;Р%%%%%%%%%%%%Р%sample is a two demention matrix,each row is a featureР[feature_num,sample_num]=size(sample);Рfuzzy=zeros(class_num,sample_num);Рclass_center=initial_center;Рclass_cen=initial_center;Рtime=0;Рwhile(1)Р for i=1:sample_numР for j=1:class_numР fuzzy(j,i)=(sample(:,i)-class_center(:,j))'*...Р (sample(:,i)-class_center(:,j))+eps;Р fuzzy(j,i)=fuzzy(j,i).^(-(1/(b-1)));Р endР endР normal_fuzzy=sum(fuzzy,1);Р for j=1:class_numР fuzzy(j,:)=fuzzy(j,:)./normal_fuzzy;Р endР for j=1:class_numР sum_fuzzy=sum((fuzzy(j,:).^b),2)+eps;Р for k=1:feature_numР class_center(k,j)=((fuzzy(j,:).^b)*sample(k,:)')/(sum_fuzzy);Р endР endР time=time+1;Р if sum(sum((class_center-class_cen).*(class_center-class_cen)))<0.001;Р break;Р endР class_cen=class_center;Рend