Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

 

generates random variates from over 870 univariate distributions

rectline_cdf(x,w,h)
% rectline_cdf.m - compute Rectangle-Line Cumulative Distribution Function.
%   See "On the Probability Distribution of the Minimal Number of Hops
%   Between any Pair of Nodes in a Bounded Wireless Ad-Hoc Network Subject
%   to Fading", S. Mukherjee and D. Avidor, Lucent.               
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  07/24/06.
%

function [cdf] = rectline_cdf(x,w,h)

tol = 1e-8;
trace = [];
warning off MATLAB:quad:MinStepSize;

minx = min(x);

% Integrate PDF to get CDF.
warning off MATLAB:quad:MinStepSize
sz = size(x,2);
for jz = 1:sz
    cdf(jz) = quad(@rectline_pdf,minx,x(jz),tol,trace,w,h);
end

return



Contact us