function v = supsiA(A,m0,n0) global m n A0 myopt m = m0; n = n0; A0 = A; w = rand(n,1); [w,fv] = fminunc(@PsiA,w,myopt); v = -fv; return function y = PsiA(w) global A0 m n S = 0; w = w/sqrt(sum(w.^2)); for i=1:n Psp = Psiw(A0(i,:)',m,n,w); Psn = Psiw(-A0(i,:)',m,n,w); Pspn = max(Psp,Psn); S = S + Pspn^2; end y = -S; return function S = Psiw(K,m,n,w) S = 0; for i=1:n S = S + w(i)*sum(pl(K)); K = getK1(K,m,n-i+1); end return