Membership  function for spherical fuzzy clustering

Input: data set 𝒜 ⊂ (ℝ^n), centers (Subscript[c, 1]),⃛,(Subscript[c, k]) ∈ (ℝ^n), indexes i, j;
Output: membership function (Subscript[u, ij]);
Submodules: none needed

q=2;
mu[A_,cen_,i_,j_]:=Module[{uu,Ii={}},
Do[
If[A[[i]]==cen[[s]],Ii=Append[Ii,s]]
,{s,Length[cen]}]; 
If[Ii=={},
uu=1/Sum[(Norm[A[[i]]-cen[[j]]]^2/Norm[A[[i]]-cen[[s]]]^2)^(1/(q-1)),{s,Length[cen]}],
If[MemberQ[Ii,j],uu=1/Length[Ii],uu=0]];
uu
]