Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

% apd_cdf.m - compute Asymmetric Power Cumulative Distribution Function.
%   See "Plume Study of a 1.35 KW SPT-100 Using an EXB Probe", AIAA-99-2423, 
%   S. W. Kim and A. D. Gallimore, U Michigan.               
%               Vector Form of CDF !!!
%  Created by:  Jim Huntley,  09/14/06.

function [cdf] = genmax_cdf(x,alpha,bet,n)

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(@genmax_pdf,minx,x(jz),tol,trace,alpha,bet,n);

cdf = cdf ./ max(cdf);


Contact us