% DDBN file ddbn.m Step graph of distribution function % Version of 10/25/95 % Plots step graph of dbn function FX from % distribution of simple rv (or simple approximation) xc = input('Enter row matrix of VALUES '); pc = input('Enter row matrix of PROBABILITIES '); m = length(xc); FX = cumsum(pc); xt = [xc(1)-1-0.1*abs(xc(1)) xc xc(m)+1+0.1*abs(xc(m))]; FX = [0 FX 1]; % Artificial extension of range and domain stairs(xt,FX) % Plot of stairstep graph hold on plot(xt,FX,'o') % Marks values at jump hold off grid xlabel('t') ylabel('u = F(t)') title('Distribution Function')