function Mary_combination_2prod_cutEnds_noMeas(loadname,Gname, Fname,savename,cutInd,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(cutInd+1:noMeas:end-cutInd,:);

Fname = Fname(cutInd+1:noMeas:end-cutInd,:);
Wn = Wn(cutInd+1:noMeas:end-cutInd,cutInd+1:noMeas:end-cutInd);

Gdy = Fname;
[Laverage,Lworst,Haverage,Hworst] = optimalcomb_Average(Gname,Gdy,Wn,Wd,Juu,Fname);
D = Hworst * Gname * inv(G1);
Hopt = inv(D) * Hworst;
c1 = CV1s;
c2 = CV2s;
c_nom = [c1 c2];


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