lam =0:10:10000;
nlam = 1;
nbins = 50;
tk = zeros(length(lam),1);
for i=1:length(lam)
    tk(i) = exprnd(lam(i), [nlam,1]) 
end
%x1 = exprnd(lam, [nlam,1]);


h = histogram(tk, nbins, 'Normalization', 'probability');
xx = h.BinEdges(2:end);
yy = h.Values;

close all
semilogy(xx, yy, 'or')