function [Exxlyr,wg_avg] = CalcYoungMod_3(Ncells,l,h,Emxx,Egxx,tg,mu)
    %calcula modulo elastico en x y y
  
    %porcentaje de grafeno en la celda
    sigma = 0.05;
    sed = rand(Ncells,Ncells)
    %wg = erfinv(2*sed-1)*sigma*sqrt(2)+mu;
    wg = norminv(sed,mu,sigma), pause(0.5)
    
    agrafcell = l*h*wg;          %relacion 1:1
    lg = sqrt(agrafcell);
    hg = lg;
    agraf = sum(sum(agrafcell));
    arve = l*h*Ncells^2;
    wg_avg = agraf/arve;
    Klayer = 0.0;
    
    lamb1 = (h-hg)./(l-lg);
    lamb2 = (h-hg)./(2*lg);
    lamb3 = 2*hg./(l-lg);
    lamb4 = hg./lg;
    
    kxxcell = 1.0./(2*Emxx*tg*lamb1.*lamb2./(lamb1+2.*lamb2) + Emxx*Egxx*tg*lamb3.*lamb4./(Emxx*lamb3+2*Egxx*lamb4));
    Kxxrow = 1.0/sum(kxxcell,2);
    Klayer = sum(Kxxrow);
    Exxlyr = Klayer*1.0/tg;
      
 return