function [A,fval] = minmaxvar(m0,n0,e0) global m n H0 e T = n-1; m=m0; n=n0; e = e0; %H0 = H; adim = m^2*T; LB = zeros(adim,1); UB = ones(adim,1); UB = UB*e; if 0 % normalization constraints Aeq = zeros(m*T,adim); for i=1:m*T for j=1:m Aeq(i,m*(i-1)+j) = 1; end end Beq = ones(m*T,1); end %A = repmat(eye(m),[1 1 T]); %C = ones(m,1)/m; %[fval,x] = probdev_qp(A,C); %return %A = A + randn(m,m,T)/1000; %A = pnormdim(A,1); x = rand(m,m,T)*e; [x,fval] = fmincon(@myobj1,x(:),[],[],[],[],LB,UB); %[x,fval] = fmincon(@myobj,A(:),[],[],Aeq,Beq,LB,UB,@mycon); x = reshape(x,[m m T]); A = repmat(eye(m),[1 1 T]); A = pnormdim(A+x,1); return function y = myobj1(x) global m n H0 T = n-1; x = reshape(x,[m m T]); A = repmat(eye(m),[1 1 T]); A = pnormdim(A+x,1); C = ones(m,1)/m; [y,x] = probdev_qp(A,C); return function [C, Ceq] = mycon(x) global m n H0 T = n-1; A = reshape(x,[m m T]); H = getH(A); C = H - H0; Ceq = 0; return function y = myobj(x) global m n H0 T = n-1; A = reshape(x,[m m T]); C = ones(m,1)/m; [y,x] = probdev_qp(A,C); return