function Mary_combination_2prod(loadname,Gname, Fname,savename,NoMeas)
clc
% clear 
%load allmat_2est_Ol.mat

load(loadname,'Gy','Gyscal','Gyscalxy','G1','G1scal','F','Fscal','Wd','Wn','y_nom','CV1s','CV2s') 
% load allmat_2est_Ol_xAsUnewJ_pref_dynData.mat

% Eig(Juu) is negative, so I used this equation
Juu = G1.' * G1;


Gname = Gname(NoMeas:NoMeas:end-1,:);

Fname = Fname(NoMeas:NoMeas:end-1,:);
Wn = Wn(NoMeas:NoMeas:end-1,NoMeas:NoMeas:end-1);

Gdy = Fname;
[Laverage,Lworst,Haverage,Hworst] = optimalcomb_Average(Gname,Gdy,Wn,Wd,Juu,Fname);
D = Hworst * Gname * inv(G1);
Hopt = inv(D) * Hworst;
% c1 = xDs(3);
% c2 = xBs(2);

% c1 = CV1s;
% c2 = CV2s;
% c_nom = [c1 c2];
c_nom = [9.479e-003 3.8068e-002];

% save comb_2prod_Hopt_dynData Hopt y_nom c_nom
save(savename,'Hopt','y_nom','c_nom')
