Generation of Random Variates
09 Feb 2012
generates random variates from over 870 univariate distributions
% mckay2_cdf.m - compute McKay II Cumulative Distribution Function.
% See "Sum & Difference of 2 Squared Correlated Nakagami Variates
% in Connection with the McKay Distribution", H. Holm & M-S Alouini,
% IEEE Trans. Comm., Vol. 52, No. 8, August 2004, p. 1368.
% Vector Form of CDF !!!
% Created by: Jim Huntley, 03/31/05.
function [cdf] = mckay2_cdf(x,a,b,c)
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(@mckay2_pdf,minx,x(jz),tol,trace,a,b,c);