function poisson03fig1 % Fig. B.5 Book Illustration for Poisson distribution % with 3 parameter values (3/2007): clc % clear variables, but must come before globals, % else clears globals too. fprintf('\nfunction poisson03fig1 OutPut:'); lv =[0.2,1.0,2.0,5.0]; nlam = 4; nk = 10; kv = 0:nk; pv = zeros(nk+1,nlam); for ilam = 1:nlam pv(1,ilam) = exp(-lv(ilam)); for k = 1:nk kv(k+1) = k; pv(k+1,ilam) = pv(1,ilam)*(lv(ilam))^k/factorial(k); end end kfig = 1; figure(kfig); scrsize = get(0,'ScreenSize'); ss = [3.0,2.8,2.6,2.4,2.2,2.0]; plot(kv,pv(:,1),'ko--',kv,pv(:,2),'k^:',kv,pv(:,3),'ks-.'... ,kv,pv(:,4),'kd-.'... ,'MarkerSize',10,'MarkerFaceColor','k','LineWidth',2) title('Poisson Distributions: p_k(\Lambda)'... ,'Fontsize',44,'FontWeight','Bold'); ylabel('p_k(\Lambda)'... ,'Fontsize',44,'FontWeight','Bold'); xlabel('k, Poisson Counter'... ,'Fontsize',44,'FontWeight','Bold'); hlegend=legend('\Lambda = 0.2','\Lambda = 1.0','\Lambda = 2.'... ,'\Lambda = 5.','Location','NorthEast'); set(hlegend,'Fontsize',36,'FontWeight','Bold'); set(gca,'Fontsize',36,'FontWeight','Bold','linewidth',3); set(gcf,'Color','White','Position'... ,[scrsize(3)/ss(kfig) 70 scrsize(3)*0.60 scrsize(4)*0.80]); % End poisson03fig1