function Psig = stat_sym_sig(P,m,n,f) Psig = zeros(2^n,1); for xi=1:m^n x = i2c(xi,m,n); fx = f(x); for yi=1:m^n y = i2c(yi,m,n); fy = f(y); sig = sign(fx-fy+eps)'; sigi = (sig+1)/2 + 1; si = c2i(sigi,2,n); Psig(si) = Psig(si) + P(xi) * P(yi); end end return function fx = getfx(f,x) fx = f(x); return function c=i2c(i,m,n) dims = repmat(m,[1 n]); c = ind2coord(i,dims); return function i=c2i(c,m,n) dims = repmat(m,[1 n]); i = coord2ind(c,dims); return