function F = lmaxcdf(x,l,w,gbar,Etaext,Rext)
F1 = expcdf(l/w*((Etaext(3:end)-Etaext(2:end-1))./(Rext(3:end)-Rext(2:end-1))),gbar);
F2 = expcdf(l/w*((Etaext(2:end-1)-Etaext(1:end-2))./(Rext(2:end-1)-Rext(1:end-2))),gbar);
F3 = expcdf(l*Etaext(2:end-1)./(w*Rext(2:end-1)-x),gbar);
F = sum(F3.*(F1-F2));
end